[go: nahoru, domu]

Skip to content

Commit

Permalink
Switch document generation to use the snippets package (flutter#87231)
Browse files Browse the repository at this point in the history
Switch document generation to use the snippets package instead of the snippets code in the Flutter repo. In the process, some bugs in sample code analysis have been fixed, and I've fixed some more errors in the samples.

This will allow the snippets package to be developed separately from the Flutter repo, and reduce the code in the Flutter repo.

The snippets code is deleted in this PR.

I also converted some comments in the snippet templates to be regular comments instead of doc comments, because having a doc comment block before the imports causes the Dart import sorter to lose the comment. They should have been regular comments in the first place.

The snippets package resides in the assets-for-api-docs repo.

The sample analysis has also been converted to be run in parallel, and I've bumped the Dartdoc version to 1.0.2.
  • Loading branch information
gspencergoog committed Aug 12, 2021
1 parent 0340319 commit 10e4b04
Show file tree
Hide file tree
Showing 47 changed files with 347 additions and 1,378 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ task:
- name: docs-linux # linux-only
environment:
CPU: 4
MEMORY: 8G
MEMORY: 12G
only_if: "$CIRRUS_PR != ''"
script:
- ./dev/bots/docs.sh
Expand Down
11 changes: 6 additions & 5 deletions dartdoc_options.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# This file is used by dartdoc when generating API documentation for Flutter.
dartdoc:
# Before you can run dartdoc, the snippets tool needs to have a snapshot built.
# The dev/tools/dartdoc.dart script does this automatically.
# Before you can run dartdoc, the snippets tool needs to be
# activated with "pub global activate snippets <version>"
# The dev/bots/docs.sh script does this automatically.
tools:
snippet:
command: ["dev/snippets/lib/main.dart", "--type=snippet"]
command: ["bin/cache/dart-sdk/bin/pub", "global", "run", "snippets", "--output-directory=doc/snippets", "--type=snippet"]
description: "Creates sample code documentation output from embedded documentation samples."
sample:
command: ["dev/snippets/lib/main.dart", "--type=sample"]
command: ["bin/cache/dart-sdk/bin/pub", "global", "run", "snippets", "--output-directory=doc/snippets", "--type=sample"]
description: "Creates full application sample code documentation output from embedded documentation samples."
dartpad:
command: ["dev/snippets/lib/main.dart", "--type=sample", "--dartpad"]
command: ["bin/cache/dart-sdk/bin/pub", "global", "run", "snippets", "--output-directory=doc/snippets", "--type=dartpad"]
description: "Creates full application sample code documentation output from embedded documentation samples and displays it in an embedded DartPad."
errors:
# Default errors of dartdoc:
Expand Down
Loading

0 comments on commit 10e4b04

Please sign in to comment.