This change allows the example writer to add doc-region annotations to
files that do not allow comments. This is done by creating a clone of the
file and adding `.annotated` to the file name. This new file can contain
inline `// ...` comments that can be used to annotate the doc regions.
Example:
**package.json**
```
{
"name": "angular.io",
"version": "0.0.0",
"main": "index.js",
"repository": "git@github.com:angular/angular.git",
"author": "Angular",
"license": "MIT",
"private": true,
}
````
**package.json.annotated**
```
{
"name": "angular.io",
// #docregion version
"version": "0.0.0",
// #enddocregion
"main": "index.js",
"repository": "git@github.com:angular/angular.git",
"author": "Angular",
"license": "MIT",
"private": true,
}
````
This region can then be referenced in examples just like any other doc region:
```
{@example 'package.json' region="version"}
```
The rationale of this change is to improve the inter-operability with web
components that might make use of the `<template>` tag.
DEPRECATION
The template tags and template attribute are deprecated:
<template ngFor [ngFor]=items let-item><li>...</li></template>
<li template="ngFor: let item of items">...</li>
should be rewritten as:
<ng-template ngFor [ngFor]=items let-item><li>...</li></ng-template>
Note that they still be supported in 4.x with a deprecartion warning in
development mode.
MIGRATION
- `template` tags (or elements with a `template` attribute) should be rewritten
as a `ng-template` tag,
- `ng-content` selectors should be updated to referto a `ng-template` where they
use to refer to a template: `<ng-content selector="template[attr]">` should be
rewritten as `<ng-content selector="ng-template[attr]">`
- if you consume a component relying on your templates being actual `template`
elements (that is they include a `<ng-content selector="template[attr]">`). You
should still migrate to `ng-template` and make use of `ngProjectAs` to override
the way `ng-content` sees the template:
`<ng-template projectAs="template[attr]">`
- while `template` elements are deprecated in 4.x they continue to work.
In #14388 the following syntax is used in the source:
```
import * as view_utils from './linker/view_utils';
import * as viewEngine from './view/index';
…
export {view_utils as ɵview_utils};
export {viewEngine as ɵviewEngine};
```
The usage of `export {... as ...}` was not being recognised by dgeni.
It is now being recognised and a temporary dummy output file is being
rendered. Later we will either ignore this doctype altogether or find
a better way of rendering it.
All the docs related files (docs-app, doc-gen, content, etc)
are now to be found inside the `/aio` folder.
The related gulp tasks have been moved from the top level
gulp file to a new one inside the `/aio` folder.
The structure of the `/aio` folder now looks like:
```
/aio/
build/ # gulp tasks
content/ #MARKDOWN FILES for devguides, cheatsheet, etc
devguides/
cheatsheets/
transforms/ #dgeni packages, templates, etc
src/
app/
assets/
content/ #HTML + JSON build artifacts produced by dgeni from /aio/content.
#This dir is .gitignored-ed
e2e/ #protractor tests for the doc viewer app
node_modules/ #dependencies for both the doc viewer builds and the dgeni stuff
#This dir is .gitignored-ed
gulpfile.js #Tasks for generating docs and building & deploying the doc viewer
```
Closes#14361