| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * To generate docs for a library, run this script with the path to an | 6 * To generate docs for a library, run this script with the path to an |
| 7 * entrypoint .dart file, like: | 7 * entrypoint .dart file, like: |
| 8 * | 8 * |
| 9 * $ dart dartdoc.dart foo.dart | 9 * $ dart dartdoc.dart foo.dart |
| 10 * | 10 * |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 defaultsTo: false, negatable: false, | 91 defaultsTo: false, negatable: false, |
| 92 callback: (incApi) => dartdoc.includeApi = incApi); | 92 callback: (incApi) => dartdoc.includeApi = incApi); |
| 93 | 93 |
| 94 argParser.addFlag('link-api', | 94 argParser.addFlag('link-api', |
| 95 help: 'Link to the online language API in the generated\n' | 95 help: 'Link to the online language API in the generated\n' |
| 96 'documentation. The option overrides inclusion\n' | 96 'documentation. The option overrides inclusion\n' |
| 97 'through --include-api or --include-lib.', | 97 'through --include-api or --include-lib.', |
| 98 defaultsTo: false, negatable: false, | 98 defaultsTo: false, negatable: false, |
| 99 callback: (linkApi) => dartdoc.linkToApi = linkApi); | 99 callback: (linkApi) => dartdoc.linkToApi = linkApi); |
| 100 | 100 |
| 101 argParser.addFlag('show-private', |
| 102 help: 'Document private types and members.', |
| 103 defaultsTo: false, |
| 104 callback: (showPrivate) => dartdoc.showPrivate = showPrivate); |
| 105 |
| 106 argParser.addFlag('inherit-from-object', |
| 107 help: 'Show members inherited from Object.', |
| 108 defaultsTo: false, negatable: false, |
| 109 callback: (inherit) => dartdoc.inheritFromObject = inherit); |
| 110 |
| 101 argParser.addFlag('enable-diagnostic-colors', negatable: false); | 111 argParser.addFlag('enable-diagnostic-colors', negatable: false); |
| 102 | 112 |
| 103 argParser.addOption('out', | 113 argParser.addOption('out', |
| 104 help: 'Generates files into directory specified. If\n' | 114 help: 'Generates files into directory specified. If\n' |
| 105 'omitted the files are generated into ./docs/', | 115 'omitted the files are generated into ./docs/', |
| 106 callback: (outDir) { | 116 callback: (outDir) { |
| 107 if(outDir != null) { | 117 if(outDir != null) { |
| 108 dartdoc.outputDir = new Path.fromNative(outDir); | 118 dartdoc.outputDir = new Path.fromNative(outDir); |
| 109 } | 119 } |
| 110 }); | 120 }); |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 Future compiled = compileScript(dartdoc.mode, dartdoc.outputDir, libPath); | 201 Future compiled = compileScript(dartdoc.mode, dartdoc.outputDir, libPath); |
| 192 Future filesCopied = copyDirectory(scriptDir.append('../static'), | 202 Future filesCopied = copyDirectory(scriptDir.append('../static'), |
| 193 dartdoc.outputDir); | 203 dartdoc.outputDir); |
| 194 | 204 |
| 195 Futures.wait([compiled, filesCopied]).then((_) { | 205 Futures.wait([compiled, filesCopied]).then((_) { |
| 196 dartdoc.cleanup(); | 206 dartdoc.cleanup(); |
| 197 print('Documented ${dartdoc.totalLibraries} libraries, ' | 207 print('Documented ${dartdoc.totalLibraries} libraries, ' |
| 198 '${dartdoc.totalTypes} types, and ${dartdoc.totalMembers} members.'); | 208 '${dartdoc.totalTypes} types, and ${dartdoc.totalMembers} members.'); |
| 199 }); | 209 }); |
| 200 } | 210 } |
| OLD | NEW |