Commit Graph

19 Commits

Author SHA1 Message Date
Greg Spencer
183bc15816
Move snippets package back into flutter repo (#147690)
## Description

This moves the snippets package back into the Flutter repo so that API documentation generation can happen without the use of `dart pub global run` because `pub run` doesn't handle concurrency well.

The change modifies the dartdoc building process to include building an executable from the snippets tool and installing that in the cache directory for use during docs generation.

The snippets tool will reside in dev/snippets, where it originally resided before being moved to https://github.com/flutter/assets-for-api-docs.

The snippets code itself is unchanged from the code that is in https://github.com/flutter/assets-for-api-docs/packages/snippets.

## Related Issues
 - https://github.com/flutter/flutter/issues/144408
 - https://github.com/flutter/flutter/issues/147609
 - https://github.com/flutter/flutter/pull/147645

## Tests
 - Added snippets tests to the overall testing build.
2024-05-03 06:09:03 +00:00
Kallen Tu
2c976b48d4
Add missing_code_block_language_in_doc_comment lint. (#145354)
Adds this Dartdoc lint to the flutter repository, in replacement of the
warning it used to have.

Lint Proposal: https://github.com/dart-lang/linter/issues/4904

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
[Data Driven Fixes]:
https://github.com/flutter/flutter/wiki/Data-driven-Fixes
2024-04-03 16:00:25 -07:00
Michael Goderbauer
6995275bba
Enable missing-code-block-language (#144443) 2024-03-01 01:06:53 +00:00
Michael Goderbauer
24b99e5de8
Add dartdoc warnings (#138766)
Follow-up to https://github.com/flutter/flutter/pull/138760.
2023-11-21 01:02:00 +00:00
Michael Goderbauer
58b647812e
Dartdoc warnings (#137077)
Follow-up to https://github.com/flutter/flutter/pull/136975.
2023-10-23 22:59:59 +00:00
Michael Goderbauer
997a94fd1f
Bump dartdoc to 7.0.1 and clean-up (#136975)
These warnings/errors have been removed from dartdoc. Removing them from the flutter config as well.

Also fixes CI to actually test doc generation for all documented packages and on dartdoc config changes.
2023-10-20 22:13:28 +00:00
Greg Spencer
a7310dc0d4
Eliminate uses of pub executable in docs publishing and sample analysis. (#89181) 2021-08-30 12:16:05 -07:00
Greg Spencer
10e4b04010
Switch document generation to use the snippets package (#87231)
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.
2021-08-11 19:48:29 -07:00
Janice Collins
e9a9a6104c
Update dartdoc to 0.35.0 (#67432) 2020-10-07 08:47:05 -07:00
Michael Goderbauer
923eb765f0
Bump dartdoc to 0.34.0 (#66048) 2020-09-22 12:57:13 -07:00
Michael Goderbauer
94f76d614c
Alphabetize warning list (#62611) 2020-07-31 10:01:03 -07:00
Michael Goderbauer
6ca8fda978
After cleaning up 812 warnings: Make warnings fatal in dartdocs (#62553) 2020-07-30 14:11:23 -07:00
Michael Goderbauer
f4e10b4fb5
Make dartdoc warnings fatal (& cleanup of warnings) (#62367) 2020-07-28 16:11:04 -07:00
Michael Goderbauer
4b4287ba78
Make it an error to break macros in docs (and fix existing broken macros) (#62071) 2020-07-23 08:29:46 -07:00
Greg Spencer
fabf4e3d0d Reverse the sense of the terms snippet and sample. (#48254) 2020-01-08 15:28:02 -08:00
Andrew Brogdon
691977755c
Adds DartPad option to the DartDoc snippet generator. (#39924) 2019-09-10 08:36:14 -07:00
Greg Spencer
9d878ca493
Remove snippets snapshotting hack from dartdoc generation. (#24812)
Now that dartdoc automatically generates snapshots for external dart tools, I can remove my path hack from the dartdoc_options.yaml file.

This will allow other packages to again build dartdocs (e.g. plugins) that link to Flutter's dartdocs, and allow me to re-enable dartdoc's cross-linking test that was disabled because of this hack.
2018-11-27 22:31:49 -08:00
Greg Spencer
094f93dfcf
Fixes several bugs in samples, quotes HTML properly, and pre-compiles snippet tool. (#24020)
When converting all of the samples to use the snippet tool, I encountered some bugs/shortcomings:

1. The document production took 90 minutes, since the snippet tool was being invoked from the command line each time. I fixed this by snapshotting the executable before running, so it's down to 7 minutes.

2. The sample code was not being properly escaped by the snippet tool, so generics were causing issues in the HTML output. It is now quoted.

3. Code examples that used languages other than Dart were not supported. Anything that highlight.js was compiled for dartdoc with is now supported.

4. The comment color for highlight.js was light grey on white, which was pretty unreadable. It's now dark green and bold.
2018-11-07 08:29:14 -08:00
Greg Spencer
65d3ddd5d1
Dartdoc snippet extension to inject full featured code snippets in to API docs. (#23281)
This creates a custom dartdoc tool that will generate snippet blocks in our API docs that allow the user to copy easily to the clipboard, and will also embed the snippet code into a template to show it in a larger context with an app.

This PR adds the snippet tool, a template, and a couple of HTML skeleton files, one for snippets that are designed to be in an application setting, and one where it simply puts a nice container around existing snippets, making them easier to copy to the clipboard.
2018-10-23 13:50:24 -07:00