OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 final name = path.basename(entity.path); | 101 final name = path.basename(entity.path); |
102 // TODO(rnystrom): Hackish. Ignore 'hidden' files like .DS_Store. | 102 // TODO(rnystrom): Hackish. Ignore 'hidden' files like .DS_Store. |
103 if (name.startsWith('.')) return; | 103 if (name.startsWith('.')) return; |
104 | 104 |
105 File fromFile = entity; | 105 File fromFile = entity; |
106 File toFile = new File(path.join(to, name)); | 106 File toFile = new File(path.join(to, name)); |
107 futureList.add(fromFile.openRead().pipe(toFile.openWrite())); | 107 futureList.add(fromFile.openRead().pipe(toFile.openWrite())); |
108 } | 108 } |
109 }, | 109 }, |
110 onDone: () => Future.wait(futureList).then((_) => completer.complete()), | 110 onDone: () => Future.wait(futureList).then((_) => completer.complete()), |
111 onError: (e) => completer.completeError(e)); | 111 onError: completer.completeError); |
112 return completer.future; | 112 return completer.future; |
113 } | 113 } |
114 | 114 |
115 /** | 115 /** |
116 * Compiles the dartdoc client-side code to JavaScript using Dart2js. | 116 * Compiles the dartdoc client-side code to JavaScript using Dart2js. |
117 */ | 117 */ |
118 Future compileScript(int mode, String outputDir, String libPath, String tmpPath)
{ | 118 Future compileScript(int mode, String outputDir, String libPath, String tmpPath)
{ |
119 print('Compiling client JavaScript...'); | 119 print('Compiling client JavaScript...'); |
120 var clientScript = (mode == MODE_STATIC) ? 'static' : 'live-nav'; | 120 var clientScript = (mode == MODE_STATIC) ? 'static' : 'live-nav'; |
121 var dartdocLibPath = path.join(libPath, 'lib', '_internal', 'dartdoc', 'lib'); | 121 var dartdocLibPath = path.join(libPath, 'lib', '_internal', 'dartdoc', 'lib'); |
(...skipping 2190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2312 return ''' | 2312 return ''' |
2313 <div class="mdn"> | 2313 <div class="mdn"> |
2314 $mdnComment | 2314 $mdnComment |
2315 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> | 2315 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> |
2316 </div> | 2316 </div> |
2317 '''; | 2317 '''; |
2318 } | 2318 } |
2319 | 2319 |
2320 String toString() => mdnComment; | 2320 String toString() => mdnComment; |
2321 } | 2321 } |
OLD | NEW |