diff --git a/dev/bots/docs.sh b/dev/bots/docs.sh index 29afcac8f8..0e278e9f94 100755 --- a/dev/bots/docs.sh +++ b/dev/bots/docs.sh @@ -6,6 +6,7 @@ echo "Running docs.sh" # If you want to run this script locally, make sure you run it from # the root of the flutter repository. export FLUTTER_ROOT="$PWD" +export PATH="$PWD/bin:$PATH" # This is called from travis_upload.sh on Travis. @@ -21,7 +22,7 @@ if [ -d "$FLUTTER_PUB_CACHE" ]; then fi # Install dartdoc. -bin/cache/dart-sdk/bin/pub global activate dartdoc 0.17.1+1 +bin/cache/dart-sdk/bin/pub global activate dartdoc 0.18.1 # This script generates a unified doc set, and creates # a custom index.html, placing everything into dev/docs/doc. diff --git a/dev/docs/README.md b/dev/docs/README.md index 88a7221ed7..0b3691b62a 100644 --- a/dev/docs/README.md +++ b/dev/docs/README.md @@ -1,4 +1,11 @@ -This directory contains the documentation generator for -. Those docs are updated only for the beta -branch, see <../bots/docs.sh>. You can find docs for the master branch -staged at . +Flutter is Google’s mobile UI framework for crafting high-quality native +interfaces on iOS and Android in record time. Flutter works with existing code, +is used by developers and organizations around the world, and is free and open +source. + +### Documentation + +* **Main site: [flutter.io]()** +* [Install](https://flutter.io/setup/) +* [Get started](https://flutter.io/getting-started/) +* [Contribute](CONTRIBUTING.md) diff --git a/dev/tools/dartdoc.dart b/dev/tools/dartdoc.dart index c67e388631..0870ca840e 100644 --- a/dev/tools/dartdoc.dart +++ b/dev/tools/dartdoc.dart @@ -131,8 +131,7 @@ Future main(List arguments) async { '--exclude', 'package:Flutter/temp_doc.dart,package:http/browser_client.dart,package:intl/intl_browser.dart,package:matcher/mirror_matchers.dart,package:quiver/mirrors.dart,package:quiver/io.dart,package:vm_service_client/vm_service_client.dart,package:web_socket_channel/html.dart', '--favicon=favicon.ico', - '--use-categories', - '--category-order', 'flutter,Dart Core,flutter_test,flutter_driver', + '--package-order', 'flutter,Dart,flutter_test,flutter_driver', '--show-warnings', '--auto-include-dependencies', ]); @@ -144,6 +143,9 @@ Future main(List arguments) async { dartdocArgs.add(libraryRef); } + String quote(String arg) => arg.contains(' ') ? "'$arg'" : arg; + print('Executing: (cd dev/docs ; $pubExecutable ${dartdocArgs.map(quote).join(' ')})'); + process = await Process.start( pubExecutable, dartdocArgs, @@ -208,32 +210,16 @@ void createFooter(String footerPath) { } void sanityCheckDocs() { - // TODO(jcollins-g): remove old_sdk_canaries for dartdoc >= 0.10.0 - final List oldSdkCanaries = [ - '$kDocRoot/api/dart.io/File-class.html', - '$kDocRoot/api/dart.ui/Canvas-class.html', - '$kDocRoot/api/dart.ui/Canvas/drawRect.html', - ]; - final List newSdkCanaries = [ + final List canaries = [ '$kDocRoot/api/dart-io/File-class.html', '$kDocRoot/api/dart-ui/Canvas-class.html', '$kDocRoot/api/dart-ui/Canvas/drawRect.html', - ]; - final List canaries = [ + '$kDocRoot/api/flutter_driver/FlutterDriver/FlutterDriver.connectedTo.html', '$kDocRoot/api/flutter_test/WidgetTester/pumpWidget.html', '$kDocRoot/api/material/Material-class.html', '$kDocRoot/api/material/Tooltip-class.html', '$kDocRoot/api/widgets/Widget-class.html', ]; - bool oldMissing = false; - for (String canary in oldSdkCanaries) { - if (!new File(canary).existsSync()) { - oldMissing = true; - break; - } - } - if (oldMissing) - canaries.addAll(newSdkCanaries); for (String canary in canaries) { if (!new File(canary).existsSync()) throw new Exception('Missing "$canary", which probably means the documentation failed to build correctly.'); @@ -248,6 +234,7 @@ void createIndexAndCleanup() { renameApiDir(); copyIndexToRootOfDocs(); addHtmlBaseToIndex(); + changePackageToSdkInTitlebar(); putRedirectInOldIndexLocation(); print('\nDocs ready to go!'); } @@ -268,6 +255,17 @@ void copyIndexToRootOfDocs() { new File('$kDocRoot/flutter/index.html').copySync('$kDocRoot/index.html'); } +void changePackageToSdkInTitlebar() { + final File indexFile = new File('$kDocRoot/index.html'); + String indexContents = indexFile.readAsStringSync(); + indexContents = indexContents.replaceFirst( + '
  • Flutter package
  • ', + '
  • Flutter SDK
  • ', + ); + + indexFile.writeAsStringSync(indexContents); +} + void addHtmlBaseToIndex() { final File indexFile = new File('$kDocRoot/index.html'); String indexContents = indexFile.readAsStringSync();