@@ -27,9 +27,7 @@ Note: to ensure that this version is run when you type `dartdoc` on the command
27
27
line, make sure that ` ~/.pub-cache/bin ` is on your ` PATH ` , and before the path
28
28
to the Dart SDK.
29
29
30
- ## Running dartdoc
31
-
32
- ### Generating docs
30
+ ## Generating docs
33
31
34
32
Run ` dartdoc ` from the root directory of package. For example:
35
33
@@ -55,7 +53,36 @@ Success! Docs generated into <path-to-server-code-lab>/server_code_lab/doc/api/i
55
53
By default, the documentation is generated to the ` doc/api ` directory as static
56
54
HTML files.
57
55
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
59
86
60
87
You can view the generated docs directly from the file system, but if you want
61
88
to use the search function, you must load them with an HTTP server.
@@ -71,7 +98,7 @@ $ dhttpd --path doc/api
71
98
Navigate to ` http://localhost:8080 ` in your browser; the search function should
72
99
now work.
73
100
74
- ## Link structure
101
+ ### Link structure
75
102
76
103
dartdoc produces static files with a predictable link structure.
77
104
@@ -92,36 +119,15 @@ library-name/ # : is turned into a - e.g. dart:core => dar
92
119
93
120
File names are _ case-sensitive_ .
94
121
95
- ## Options
122
+ ## Writing docs
96
123
97
- Command-line options for dartdoc include:
124
+ Check out the
125
+ [ Effective Dart: Documentation guide] ( https://www.dartlang.org/effective-dart/documentation/ ) .
98
126
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.
123
129
124
- ## Excluding from documentation
130
+ ### Excluding from documentation
125
131
126
132
dartdoc will not generate documentation for a Dart element and its children that has
127
133
the ` <nodoc> ` tag in the documentation comment.
0 commit comments