angular-docs-cn/aio/transforms
Peter Bacon Darwin 58f080a325 build(aio): add `doc-watch` yarn task for docs authors
This task is suitable for day to day docs authoring.

This task cuts corners, which makes it much faster than a full `yarn docs`
run but it does not produce completely valid output.
In general this isgood enough for authors to see their changes as they make them.

The task is triggered by a call to

```
yarn docs-watch
```

This sets up watchers on the `aio/contents` and `packages` folders.
Any changes to files below these folders new doc generation run to start.
The input to the generation is confined to a collection of files related
to the changed file. For example:

* a change to a file in `aio/content/marketing` will generate all the
marketing files.
* a change to a file in `aio/content/tutorial` or `aio/examples/toh-*`
will generate all the tutorial files (and their embedded examples).
* a change to a file in `aio/guide` or `aio/examples` (but not a `toh-`
example) will generate the appropriate guide and its embedded examples
* a change to a file in `packages` or `packages/examples` will generate
the appropriate API doc and its embedded examples.

Be aware that the mapping between docs and its examples are based on doc file
and example folder structure being equivalent. Sometimes a doc will reference
an example in a different folder, in which case the generated doc will be
inaccurate. Mostly this is not a big problem.
2017-04-16 20:56:10 +01:00
..
angular.io-package feat(aio): implement resources with resources.json 2017-04-15 16:53:42 +01:00
authors-package build(aio): add `doc-watch` yarn task for docs authors 2017-04-16 20:56:10 +01:00
content-package test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
examples-package test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
helpers test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
links-package test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
remark-package build(aio): implement the remark renderer 2017-04-12 12:24:02 -07:00
target-package test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
templates feat(aio): add code-example and code-tabs 2017-03-27 12:25:34 +01:00
.eslintignore test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
.eslintrc.js test(aio): enable linting of `transforms/` and add rules for jasmine 2017-04-01 20:56:16 +01:00
README.md build(aio): add `doc-watch` yarn task for docs authors 2017-04-16 20:56:10 +01:00

README.md

Documentation Generation

The dgeni tool is used to generate the documentation from the source files held in this repository. The documentation generation is configured by a dgeni package defined in docs/angular.io-package/index.js. This package, in turn requires a number of other packages, some are defined locally in the docs folder, such as docs/cheatsheet-package and docs/content-package, etc. And some are brought in from the dgeni-packages node modules, such as jsdoc and nunjucks.

Generating the docs

To generate the documentation simply run yarn docs from the command line.

Testing the dgeni packages

The local packages have unit tests that you can execute by running yarn docs-test from the command line.

What does it generate?

The output from dgeni is written to files in the src/content folder.

Notably this includes a JSON file containing the partial HTML for each "page" of the documentation, such as API pages and guides. It also includes JSON files that contain metadata about the documentation such as navigation data and keywords for building a search index.

Viewing the docs

You can view the pages by running yarn start and navigating to https://localhost:4200.