-
Notifications
You must be signed in to change notification settings - Fork 124
A few minor documentation updates #3641
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,8 +14,12 @@ For issues/details related to the hosted Dart SDK API docs, see | |
|
||
## Installation | ||
|
||
The [`dart`](https://dart.dev/tools/dart-tool) tool, | ||
with the `dart doc` command, is part of the [Dart SDK](https://dart.dev/get-dart). | ||
The [`dart`][] tool, with the [`dart doc`][] command, | ||
is part of the [Dart SDK][]. | ||
|
||
[`dart`]: https://dart.dev/tools/dart-tool | ||
[`dart doc`]: https://dart.dev/tools/dart-doc | ||
[Dart SDK]: https://dart.dev/get-dart | ||
|
||
## Generating docs | ||
|
||
|
@@ -39,26 +43,31 @@ Documented 1 public library in 17.9 seconds | |
Success! Docs generated into <path to dartdoc>/doc/api | ||
``` | ||
|
||
By default, the documentation is generated to the `doc/api` directory as static | ||
HTML files. | ||
By default, the documentation is generated to the `doc/api` directory as | ||
static HTML files. | ||
|
||
To view the generated documentation, you must load them with an HTTP server. | ||
To learn more, follow the [Viewing docs](#viewing-docs) guide. | ||
|
||
Run `dart help doc` to see the available command-line options. | ||
|
||
## Viewing docs | ||
|
||
You can view the generated docs directly from the file system, but if you want | ||
to use the search function, you must load them with an HTTP server. | ||
To enable navigation and search, the generated docs must be | ||
served with an HTTP server. | ||
|
||
An easy way to run an HTTP server locally is to use the `dhttpd` package. For | ||
example: | ||
An easy way to run an HTTP server locally is to use [`package:dhttpd`][]. | ||
For example: | ||
|
||
``` | ||
$ dart pub global activate dhttpd | ||
$ dhttpd --path doc/api | ||
$ dart pub global run dhttpd --path doc/api | ||
``` | ||
|
||
Navigate to `http://localhost:8080` in your browser; the search function should | ||
now work. | ||
To then read the generated docs in your browser, | ||
open the link that `dhttpd` outputs, usually `http://localhost:8080`. | ||
|
||
[`package:dhttpd`]: https://pub.dev/packages/dhttpd | ||
|
||
## Link structure | ||
|
||
|
@@ -83,16 +92,18 @@ File names are _case-sensitive_. | |
|
||
## Writing docs | ||
|
||
Check out the | ||
[Effective Dart: Documentation guide](https://dart.dev/guides/language/effective-dart/documentation). | ||
To learn about writing documentation comments, | ||
check out the [Effective Dart: Documentation guide][]. | ||
|
||
The guide covers formatting, linking, markup, and general best practices when | ||
authoring doc comments for Dart with `dartdoc`. | ||
authoring doc comments for Dart with `dart doc`. | ||
|
||
[Effective Dart: Documentation guide]: https://dart.dev/effective-dart/documentation | ||
|
||
## Excluding from documentation | ||
|
||
`dart doc` will not generate documentation for a Dart element and its children that have the | ||
`@nodoc` tag in the documentation comment. | ||
`dart doc` will not generate documentation for a Dart element and | ||
its children that have the `@nodoc` tag in the documentation comment. | ||
|
||
## Advanced features | ||
|
||
|
@@ -501,7 +512,7 @@ Please see the [dartdoc license][]. | |
Generated docs include: | ||
|
||
* Highlight.js - | ||
[LICENSE](https://github.com/isagalaev/highlight.js/blob/main/LICENSE) | ||
[LICENSE](https://github.com/highlightjs/highlight.js/blob/main/LICENSE) | ||
* With `github.css` (c) Vasily Polovnyov <[email protected]> | ||
|
||
[GitHub Issue Tracker]: https://github.com/dart-lang/dartdoc/issues | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made this change as I notice a lot of developers end up not adding the directory to their path. This is more likely to work :)