Commit graph

265 commits

Author SHA1 Message Date
Jonah Williams 6c62cf337f
Update driver script to execute test through test_core (#24168) 2018-11-15 10:50:25 -08:00
Todd Volkert 95c9ae451e
Update packages --force-upgrade (#24126) 2018-11-08 22:31:22 -08:00
Greg Spencer a6e901130e
Convert existing '## Sample code' samples to '{@tool sample}...{@end-tool}' form. (#24077)
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.
2018-11-07 20:35:10 -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
Jonah Williams 2fc2581be4
unpin mockito (#24021) 2018-11-06 17:24:39 -08:00
Jonah Williams a43e3a4a2f
Retry remove package:test from flutter (#24007) 2018-11-06 10:48:34 -08:00
Jonah Williams 23a7535a39
Revert "Remove package:test dependency from flutter_test (#23755)" (#24004)
This reverts commit 71e9bd6f25.
2018-11-06 09:12:48 -08:00
Jonah Williams 71e9bd6f25
Remove package:test dependency from flutter_test (#23755) 2018-11-06 08:39:27 -08:00
Greg Spencer 202b045b50
Rewrite the analyze-sample-code script to also analyze snippets (#23893)
This rewrites the sample code analysis script to be a little less of a hack (but still not pretty), and to handle snippets as well.

It also changes the semantics of how sample code is handled: the namespace for the sample code is now limited to the file that it appears in, so some additional "Examples can assume:" blocks were added. The upside of this is that there will be far fewer name collisions.

I fixed the output too: no longer will you get 4000 lines of numbered output with the error at the top and have to grep for the actual problem. It gives the filename and line number of the original location of the code (in the comment in the tree), and prints out the source code on the line that caused the problem along with the error.

For snippets, it prints out the location of the start of the snippet and the source code line that causes the problem. It can't print out the original line, because snippets get formatted when they are written, so the line might not be in the same place.
2018-11-05 07:31:35 -08:00
Hans Muller dd30efa190
Revert "Restore "Flutter gallery: updated Shrine demo" (#23878)" (#23888)
This reverts commit 76a1abd4c7.
2018-11-02 15:32:02 -07:00
Hans Muller 76a1abd4c7
Restore "Flutter gallery: updated Shrine demo" (#23878) 2018-11-02 14:33:10 -07:00
Jonah Williams 0b35937b13
Revert "Flutter gallery: updated Shrine demo (#23539)" (#23848)
This reverts commit 949cfcf172.
2018-11-01 19:30:11 -07:00
Hans Muller 949cfcf172
Flutter gallery: updated Shrine demo (#23539) 2018-11-01 12:48:24 -07:00
Greg Spencer f9c6f30576
Allow users to create samples using flutter create. (#23584)
This adds flutter create --sample which allows users to execute a command which will create a working sample app from samples embedded in the API docs.

The command looks something like this:

flutter create --sample=chip.DeletableChipAttributes.onDeleted mysample
2018-10-30 16:01:14 -07: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