- 18 Apr, 2023 1 commit
-
-
Greg Spencer authored
## Description This updates the copy icon for copying sample code to use `content_copy` instead of `assignment`. Before: <img width="369" alt="223876418-2470c4c5-abfc-4511-9762-1fd0b6e05903" src="https://user-images.githubusercontent.com/8867023/228396142-450125ee-d8cf-4ede-8545-5920eb0da99d.png"> After: <img width="408" alt="image" src="https://user-images.githubusercontent.com/8867023/228395959-8531704a-77aa-43af-9dcf-7456bb2ed090.png"> ## Related Issues - Fixes https://github.com/flutter/flutter/issues/122246 ## Tests - No tests needed.
-
- 21 Sep, 2022 1 commit
-
-
Greg Spencer authored
-
- 12 Aug, 2021 1 commit
-
-
Greg Spencer authored
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.
-
- 08 Jan, 2020 1 commit
-
-
Greg Spencer authored
-
- 10 Jul, 2019 1 commit
-
-
Greg Spencer authored
This adds an "anchor button" to each of the samples so that the user can link to individual samples instead of having to link to just the page. Clicking on the anchor button jumps to the anchor, as well as copying the anchor URL to the clipboard. There is some oddness in the implementation: because dartdoc uses a <base> tag, the href for the link can't just be "#id", it has to calculate the URL from the current window href. I do that in the onmouseenter and onclick because onload doesn't get triggered for <a> tags (and onmouseenter doesn't get triggered for mobile platforms), but I still want the href to be updated before someone right-clicks it to copy the URL.
-
- 15 Feb, 2019 1 commit
-
-
Greg Spencer authored
This converts all remaining "## Sample code" segments into snippets, and fixes the snippet generator to handle multiple snippets in the same dartdoc block properly. I also generated, compiled, and ran each of the existing application samples, and fixed them up to be more useful and/or just run without errors. This PR fixes these problems with examples: 1. Switching tabs in a snippet now works if there is more than one snippet in a single dartdoc block. 2. Generation of snippet code now works if there is more than one snippet. 3. Contrast of text and links in the code sample block has been improved to recommended levels. 4. Added five new snippet templates, including a "freeform" template to make it possible to show examples that need to change the app instantiation. 5. Fixed several examples to run properly, a couple by adding the "Scaffold" widget to the template, a couple by just fixing their code. 6. Fixed visual look of some of the samples when they run by placing many samples inside of a Scaffold. 7. In order to make it easier to run locally, changed the sample analyzer to remove the contents of the supplied temp directory before running, since having files that hang around is problematic (only a problem when running locally with the `--temp` argument). 8. Added a `SampleCheckerException` class, and handle sample checking exceptions more gracefully. 9. Deprecated the old "## Sample code" designation, and added enforcement for the deprecation. 10. Removed unnecessary `new` from templates (although they never appeared in the samples thanks to dartfmt, but still). Fixes #26398 Fixes #27411
-
- 08 Nov, 2018 1 commit
-
-
Greg Spencer authored
This converts existing ## Sample code samples to {@tool sample}...{@end-tool} form. Also: 1. Fixed a minor bug in analyze-sample-code.dart 2. Made the snippet tool only insert descriptions if the description is non-empty. 3. Moved the Card diagram to before the code sample.
-
- 07 Nov, 2018 1 commit
-
-
Greg Spencer authored
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.
-
- 23 Oct, 2018 1 commit
-
-
Greg Spencer authored
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.
-