| Index: pkg/docgen/README.md
|
| diff --git a/pkg/docgen/README.md b/pkg/docgen/README.md
|
| index a26d1e952c46f91d47ad3cf4e012daa6fc25baa7..0e3b3daf4ae87e4e978e51c9c73e98c90e6d16db 100644
|
| --- a/pkg/docgen/README.md
|
| +++ b/pkg/docgen/README.md
|
| @@ -1,11 +1,65 @@
|
| +docgen
|
| +======
|
| +
|
| A documentation generator for Dart.
|
| +- - -
|
| +The docgen tool takes in a file or directory as input and produces documentation
|
| +for all `.dart` file it finds as YAML or JSON files. This outputs information
|
| +about all classes, variables, functions, and methods defined in the library and
|
| +its imported libraries.
|
| +
|
| +### Generating Files & Uploading to Cloud Storage
|
| +
|
| +The viewer uses YAML files generated by the docgen package as the data
|
| +being displayed. These files are stored in Google Cloud Storage.
|
| +
|
| + - Run `python upload_docgen.py` to generate these files and upload them to
|
| + Cloud Storage as a new version.
|
| +- - -
|
| +These tasks can be done separately if necessary:
|
| +
|
| +#####
|
| +
|
| +#### Generating YAML Files
|
| +
|
| +YAML files can be generated using the docgen package in the dart repository.
|
| +
|
| +###### Usage
|
| +
|
| +Run `dart docgen.dart [OPTIONS] <path to directory or file>`
|
| +
|
| +###### Options available
|
| +
|
| +- `-h`, `--help` Prints help and usage information.
|
| +- `-v`, `--verbose` Output more logging information.
|
| +- `-j`, `--[no-]json` Outputs to JSON. Files are outputted to YAML by default.
|
| +- `--include-private` Flag to include private declarations.
|
| +- `--include-sdk` Flag to parse SDK Library files imported.
|
| +- `--parse-sdk` Parses the SDK libraries only. (Ignores the path passed in.)
|
| +- `--package-root` Sets the package root of the library being analyzed.
|
| +
|
| +###### Output Directory
|
| +Documented libraries will be located at bin/docs in either YAML or JSON format
|
| +depending on options specified. There will also be a library_list.txt,
|
| +containing a list of all the libraries inside the docs folder.
|
| +
|
| +To get more information on how to use the outputted documentation with
|
| +dartdoc-viewer, please take a look at the
|
| +[dartdoc-viewer documentation][dartdoc-viewer].
|
| +
|
| +[dartdoc-viewer]: https://github.com/dart-lang/dartdoc-viewer "Dartdoc-Viewer"
|
|
|
| -The docgen tool takes in a library as input and produces documentation
|
| -for it as well as all libraries it imports and uses.
|
| +#### Uploading to Cloud Storage
|
|
|
| -This outputs information about all classes, variables, functions, and
|
| -methods defined in the library and its imported libraries.
|
| +To push new files to Google Cloud Storage for use by the viewer, use the
|
| +`gsutil` tool located at third_party/gsutil/gsutil in the Dart repository.
|
|
|
| -## USAGE
|
| + - Run `python gsutil -m cp -q -a public-read -r <folder> gs://dartlang-docgen`
|
| + to upload the specified folder to the viewer's bucket. Be sure to also upload
|
| + a new VERSION file if the uploaded folder is to be used.**
|
|
|
| - dart docgen.dart path/to/file.dart
|
| +**Note that the bucket contains several numbered folders for each version of
|
| +the documentation. Run `python gsutil ls gs://dartlang-docgen` to see the file
|
| +layout. Follow this convention and update a new VERSION file when uploading
|
| +a new version of documentation. You can see the format of the VERSION file
|
| +by running `python gsutil cat gs://dartlang-docgen/VERSION`.
|
|
|