Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
Implemented in dart-lang/sdk#56186

Credits @srawlins
  • Loading branch information
jonasfj authored Nov 25, 2024
1 parent ced0209 commit 358a21b
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,24 @@ dartdoc is currently documenting. This can lead to inconsistent behavior betwee
packages, especially if different command lines are used for dartdoc. It is recommended to use collision-resistant
naming for any macros by including the package name and/or library it is defined in within the name.

### Documentation imports (`/// @docImport`)

Libraries that are only referenced in documentation comments (`[Future]`) can be imported with a
`/// @docImport '<uri>'` comment on the `library` element, like:

```dart
/// @docImport 'dart:async';
/// @docImport 'package:flutter/element.dart' show Element;
/// @docImport '../path/to/somwhere.dart';
/// @docImport 'dart:html' as 'html';
library;
/// We can now reference [Future] from dart:async, [Element] from Flutter's element library,
/// and [html.Element] from dart:html, even if none of these libraries are actually imported
/// by this library.
class Foo {}
```

### Tools

Dartdoc allows you to filter parts of the documentation through an external tool
Expand Down

0 comments on commit 358a21b

Please sign in to comment.