Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: dart/utils/apidoc/apidoc.dart

Issue 10141009: Use 'frog' in apidoc. Also fix broken dependencies. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 * This generates the reference documentation for the core libraries that come 6 * This generates the reference documentation for the core libraries that come
7 * with dart. It is built on top of dartdoc, which is a general-purpose library 7 * with dart. It is built on top of dartdoc, which is a general-purpose library
8 * for generating docs from any Dart code. This library extends that to include 8 * for generating docs from any Dart code. This library extends that to include
9 * additional information and styling specific to our standard library. 9 * additional information and styling specific to our standard library.
10 * 10 *
(...skipping 15 matching lines...) Expand all
26 26
27 HtmlDiff _diff; 27 HtmlDiff _diff;
28 28
29 final GET_PREFIX = 'get:'; 29 final GET_PREFIX = 'get:';
30 30
31 void main() { 31 void main() {
32 final args = new Options().arguments; 32 final args = new Options().arguments;
33 33
34 int mode = doc.MODE_STATIC; 34 int mode = doc.MODE_STATIC;
35 String outputDir = 'docs'; 35 String outputDir = 'docs';
36 String compilerPath;
36 37
37 // Parse the command-line arguments. 38 // Parse the command-line arguments.
38 for (int i = 0; i < args.length; i++) { 39 for (int i = 0; i < args.length; i++) {
39 final arg = args[i]; 40 final arg = args[i];
40 41
41 switch (arg) { 42 switch (arg) {
42 case '--mode=static': 43 case '--mode=static':
43 mode = doc.MODE_STATIC; 44 mode = doc.MODE_STATIC;
44 break; 45 break;
45 46
46 case '--mode=live-nav': 47 case '--mode=live-nav':
47 mode = doc.MODE_LIVE_NAV; 48 mode = doc.MODE_LIVE_NAV;
48 break; 49 break;
49 50
50 default: 51 default:
51 if (arg.startsWith('--out=')) { 52 if (arg.startsWith('--out=')) {
52 outputDir = arg.substring('--out='.length); 53 outputDir = arg.substring('--out='.length);
54 } else if (arg.startsWith('--compiler=')) {
55 compilerPath = arg.substring('--compiler='.length);
53 } else { 56 } else {
54 print('Unknown option: $arg'); 57 print('Unknown option: $arg');
55 return; 58 return;
56 } 59 }
57 break; 60 break;
58 } 61 }
59 } 62 }
60 63
61 final frogPath = joinPaths(doc.scriptDir, '../../frog/'); 64 final frogPath = joinPaths(doc.scriptDir, '../../frog/');
62 final compilerPath = joinPaths(frogPath, 'minfrog');
63 final libDir = joinPaths(frogPath, 'lib'); 65 final libDir = joinPaths(frogPath, 'lib');
64 66
67 if (compilerPath === null) {
Bob Nystrom 2012/04/24 16:03:58 == null
ahe 2012/04/25 08:26:55 As I mentioned in the other code review, I'm stick
Bob Nystrom 2012/04/25 18:03:41 Ha, suit yourself. Live in fear! :)
68 compilerPath = joinPaths(frogPath, 'frog.py');
69 }
70
65 doc.cleanOutputDirectory(outputDir); 71 doc.cleanOutputDirectory(outputDir);
66 72
67 // Compile the client-side code to JS. 73 // Compile the client-side code to JS.
68 // TODO(bob): Right path. 74 // TODO(bob): Right path.
69 75
70 final clientScript = (mode == doc.MODE_STATIC) ? 76 final clientScript = (mode == doc.MODE_STATIC) ?
71 'static' : 'live-nav'; 77 'static' : 'live-nav';
72 doc.compileScript(compilerPath, libDir, 78 doc.compileScript(compilerPath, libDir,
73 '${doc.scriptDir}/../../lib/dartdoc/client-$clientScript.dart', 79 '${doc.scriptDir}/../../lib/dartdoc/client-$clientScript.dart',
74 '${outputDir}/client-$clientScript.js'); 80 '${outputDir}/client-$clientScript.js');
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 return 495 return
490 ''' 496 '''
491 <p class="correspond">This corresponds to $domTypesText in the 497 <p class="correspond">This corresponds to $domTypesText in the
492 ${a("dom.html", "dart:dom")} library.</p> 498 ${a("dom.html", "dart:dom")} library.</p>
493 '''; 499 ''';
494 } 500 }
495 501
496 return ''; 502 return '';
497 } 503 }
498 } 504 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698