Chromium Code Reviews| Index: utils/apidoc/apidoc.dart |
| diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart |
| index 3457d3250d93cf8d64fa76665f22d637b71b9af9..d557aa669784ecdeed49e881f0e2a5c963e7efc2 100644 |
| --- a/utils/apidoc/apidoc.dart |
| +++ b/utils/apidoc/apidoc.dart |
| @@ -3,7 +3,16 @@ |
| // BSD-style license that can be found in the LICENSE file. |
| /** |
| - * Generates the complete set of corelib reference documentation. |
| + * This generates the reference documentation for the core libraries that come |
| + * with dart. It is built on top of dartdoc, which is a general-purpose library |
| + * for generating docs from any Dart code. This library extends that to include |
| + * additional information and styling specific to our standard library. |
| + * |
| + * Usage: |
| + * |
| + * $ dart apidoc.dart [--out=<output directory>] |
| + * |
| + * Pretty simple. :) |
|
ahe
2012/03/17 20:19:31
Remove cute comment. It's just annoying when it do
Bob Nystrom
2012/03/19 21:09:34
Done.
|
| */ |
| #library('apidoc'); |
| @@ -37,8 +46,16 @@ void main() { |
| } |
| } |
| + final frogPath = joinPaths(doc.scriptDir, '../../frog/'); |
| + |
| doc.cleanOutputDirectory(outputDir); |
| + // Compile the client-side code to JS. |
| + // TODO(bob): Right path. |
| + doc.compileScript(frogPath, |
| + '${doc.scriptDir}/../../lib/dartdoc/client-live-nav.dart', |
| + '${outputDir}/client-live-nav.js'); |
| + |
| // TODO(rnystrom): Use platform-specific path separator. |
| // The basic dartdoc-provided static content. |
| doc.copyFiles('${doc.scriptDir}/../../lib/dartdoc/static', outputDir); |
| @@ -47,7 +64,7 @@ void main() { |
| doc.copyFiles('${doc.scriptDir}/static', outputDir); |
| var files = new VMFileSystem(); |
| - parseOptions('../../frog', ['', '', '--libdir=../../frog/lib'], files); |
| + parseOptions(frogPath, ['', '', '--libdir=$frogPath/lib'], files); |
| initializeWorld(files); |
| print('Parsing MDN data...'); |
| @@ -59,14 +76,21 @@ void main() { |
| _diff.run(); |
| world.reset(); |
| - // TODO(rnystrom): Cram in the the IO libraries. This is hackish right now. |
| - // We should probably move corelib stuff completely out of dartdoc and have it |
| - // all here. |
| + // Add all of the core libraries. |
| + world.getOrAddLibrary('dart:core'); |
| + world.getOrAddLibrary('dart:coreimpl'); |
| + world.getOrAddLibrary('dart:json'); |
| + world.getOrAddLibrary('dart:dom'); |
| + world.getOrAddLibrary('dart:html'); |
| world.getOrAddLibrary('dart:io'); |
| + world.getOrAddLibrary('dart:isolate'); |
| + world.getOrAddLibrary('dart:uri'); |
| + world.getOrAddLibrary('dart:utf'); |
| + world.process(); |
| print('Generating docs...'); |
| final apidoc = new Apidoc(mdn, outputDir); |
| - apidoc.document('html'); |
| + apidoc.document(); |
| } |
| class Apidoc extends doc.Dartdoc { |