@@ -14,8 +14,12 @@ For issues/details related to the hosted Dart SDK API docs, see
14
14
15
15
## Installation
16
16
17
- The [ ` dart ` ] ( https://dart.dev/tools/dart-tool ) tool,
18
- with the ` dart doc ` command, is part of the [ Dart SDK] ( https://dart.dev/get-dart ) .
17
+ The [ ` dart ` ] [ ] tool, with the [ ` dart doc ` ] [ ] command,
18
+ is part of the [ Dart SDK] [ ] .
19
+
20
+ [ `dart` ] : https://dart.dev/tools/dart-tool
21
+ [ `dart doc` ] : https://dart.dev/tools/dart-doc
22
+ [ Dart SDK ] : https://dart.dev/get-dart
19
23
20
24
## Generating docs
21
25
@@ -39,26 +43,31 @@ Documented 1 public library in 17.9 seconds
39
43
Success! Docs generated into <path to dartdoc>/doc/api
40
44
```
41
45
42
- By default, the documentation is generated to the ` doc/api ` directory as static
43
- HTML files.
46
+ By default, the documentation is generated to the ` doc/api ` directory as
47
+ static HTML files.
48
+
49
+ To view the generated documentation, you must load them with an HTTP server.
50
+ To learn more, follow the [ Viewing docs] ( #viewing-docs ) guide.
44
51
45
52
Run ` dart help doc ` to see the available command-line options.
46
53
47
54
## Viewing docs
48
55
49
- You can view the generated docs directly from the file system, but if you want
50
- to use the search function, you must load them with an HTTP server.
56
+ To enable navigation and search, the generated docs must be
57
+ served with an HTTP server.
51
58
52
- An easy way to run an HTTP server locally is to use the ` dhttpd ` package. For
53
- example:
59
+ An easy way to run an HTTP server locally is to use [ ` package: dhttpd` ] [ ] .
60
+ For example:
54
61
55
62
```
56
63
$ dart pub global activate dhttpd
57
- $ dhttpd --path doc/api
64
+ $ dart pub global run dhttpd --path doc/api
58
65
```
59
66
60
- Navigate to ` http://localhost:8080 ` in your browser; the search function should
61
- now work.
67
+ To then read the generated docs in your browser,
68
+ open the link that ` dhttpd ` outputs, usually ` http://localhost:8080 ` .
69
+
70
+ [ `package:dhttpd` ] : https://pub.dev/packages/dhttpd
62
71
63
72
## Link structure
64
73
@@ -83,16 +92,18 @@ File names are _case-sensitive_.
83
92
84
93
## Writing docs
85
94
86
- Check out the
87
- [ Effective Dart: Documentation guide] ( https://dart.dev/guides/language/effective-dart/documentation ) .
95
+ To learn about writing documentation comments,
96
+ check out the [ Effective Dart: Documentation guide] [ ] .
88
97
89
98
The guide covers formatting, linking, markup, and general best practices when
90
- authoring doc comments for Dart with ` dartdoc ` .
99
+ authoring doc comments for Dart with ` dart doc ` .
100
+
101
+ [ Effective Dart: Documentation guide ] : https://dart.dev/effective-dart/documentation
91
102
92
103
## Excluding from documentation
93
104
94
- ` dart doc ` will not generate documentation for a Dart element and its children that have the
95
- ` @nodoc ` tag in the documentation comment.
105
+ ` dart doc ` will not generate documentation for a Dart element and
106
+ its children that have the ` @nodoc ` tag in the documentation comment.
96
107
97
108
## Advanced features
98
109
@@ -501,7 +512,7 @@ Please see the [dartdoc license][].
501
512
Generated docs include:
502
513
503
514
* Highlight.js -
504
- [ LICENSE] ( https://github.com/isagalaev /highlight.js/blob/main/LICENSE )
515
+ [ LICENSE] ( https://github.com/highlightjs /highlight.js/blob/main/LICENSE )
505
516
* With
` github.css ` (c) Vasily Polovnyov
< [email protected] >
506
517
507
518
[ GitHub Issue Tracker ] : https://github.com/dart-lang/dartdoc/issues
0 commit comments