Skip to content

Commit 6b5a994

Browse files
committed
Add a new "writing docs" section to README
TBR
1 parent 549fadc commit 6b5a994

File tree

1 file changed

+38
-32
lines changed

1 file changed

+38
-32
lines changed

README.md

Lines changed: 38 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ Note: to ensure that this version is run when you type `dartdoc` on the command
2727
line, make sure that `~/.pub-cache/bin` is on your `PATH`, and before the path
2828
to the Dart SDK.
2929

30-
## Running dartdoc
31-
32-
### Generating docs
30+
## Generating docs
3331

3432
Run `dartdoc` from the root directory of package. For example:
3533

@@ -55,7 +53,36 @@ Success! Docs generated into <path-to-server-code-lab>/server_code_lab/doc/api/i
5553
By default, the documentation is generated to the `doc/api` directory as static
5654
HTML files.
5755

58-
### Viewing docs
56+
### Options
57+
58+
Command-line options for dartdoc include:
59+
60+
- `-h` or `--help` Display help.
61+
- `--header=<file>` Insert the specified file, which contains HTML code, into
62+
the header of every page.
63+
- `--footer=<file>` Insert the specified file, which contains HTML code, into
64+
the footer of every page.
65+
- `--input=<directory>` Generate the docs from the specified directory. If not
66+
specified, it defaults to the current directory.
67+
- `--output=<directory>` Generate the output to the specified directory. If not
68+
specified, it defaults to `doc/api`.
69+
- `--package-root=<directory>` Specify the package root of the library.
70+
- `--exclude=<lib1,lib2,lib3,...>` Exclude the specified libraries from the
71+
generated docs.
72+
- `--include=<lib1,lib2,lib3,...>` Generate docs for the specified libraries.
73+
- `--hosted-url=<url>` Build a docs sitemap using the specified URL for your
74+
website.
75+
- `--add-crossdart` Add links to [Crossdart](//crossdart.info) to the
76+
Source Code sections.
77+
78+
The following options are used only when generating docs for the Dart SDK.
79+
80+
- `--dart-sdk=<path>` Specify the location of the Dart SDK, if it can't be
81+
detected automatically.
82+
- `--sdk-docs` Generate only docs for the Dart SDK.
83+
- `--sdk-readme=<file>` Specify the README file for the Dart SDK.
84+
85+
## Viewing docs
5986

6087
You can view the generated docs directly from the file system, but if you want
6188
to use the search function, you must load them with an HTTP server.
@@ -71,7 +98,7 @@ $ dhttpd --path doc/api
7198
Navigate to `http://localhost:8080` in your browser; the search function should
7299
now work.
73100

74-
## Link structure
101+
### Link structure
75102

76103
dartdoc produces static files with a predictable link structure.
77104

@@ -92,36 +119,15 @@ library-name/ # : is turned into a - e.g. dart:core => dar
92119

93120
File names are _case-sensitive_.
94121

95-
## Options
122+
## Writing docs
96123

97-
Command-line options for dartdoc include:
124+
Check out the
125+
[Effective Dart: Documentation guide](https://www.dartlang.org/effective-dart/documentation/).
98126

99-
- `-h` or `--help` Display help.
100-
- `--header=<file>` Insert the specified file, which contains HTML code, into
101-
the header of every page.
102-
- `--footer=<file>` Insert the specified file, which contains HTML code, into
103-
the footer of every page.
104-
- `--input=<directory>` Generate the docs from the specified directory. If not
105-
specified, it defaults to the current directory.
106-
- `--output=<directory>` Generate the output to the specified directory. If not
107-
specified, it defaults to `doc/api`.
108-
- `--package-root=<directory>` Specify the package root of the library.
109-
- `--exclude=<lib1,lib2,lib3,...>` Exclude the specified libraries from the
110-
generated docs.
111-
- `--include=<lib1,lib2,lib3,...>` Generate docs for the specified libraries.
112-
- `--hosted-url=<url>` Build a docs sitemap using the specified URL for your
113-
website.
114-
- `--add-crossdart` Add links to [Crossdart](//crossdart.info) to the
115-
Source Code sections.
116-
117-
The following options are used only when generating docs for the Dart SDK.
118-
119-
- `--dart-sdk=<path>` Specify the location of the Dart SDK, if it can't be
120-
detected automatically.
121-
- `--sdk-docs` Generate only docs for the Dart SDK.
122-
- `--sdk-readme=<file>` Specify the README file for the Dart SDK.
127+
The guide covers formatting, linking, markup, and general best practices
128+
when authoring doc comments for Dart with dartdoc.
123129

124-
## Excluding from documentation
130+
### Excluding from documentation
125131

126132
dartdoc will not generate documentation for a Dart element and its children that has
127133
the `<nodoc>` tag in the documentation comment.

0 commit comments

Comments
 (0)