| 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 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 'outputDir': outputDir.toNativePath(), | 142 'outputDir': outputDir.toNativePath(), |
| 143 'libPath': libPath.toNativePath() | 143 'libPath': libPath.toNativePath() |
| 144 }).then((result) { | 144 }).then((result) { |
| 145 if (result.first == 'success') return; | 145 if (result.first == 'success') return; |
| 146 throw new AsyncError(result[1], result[2]); | 146 throw new AsyncError(result[1], result[2]); |
| 147 }); | 147 }); |
| 148 } | 148 } |
| 149 | 149 |
| 150 void _compileScript() { | 150 void _compileScript() { |
| 151 port.receive((message, replyTo) { | 151 port.receive((message, replyTo) { |
| 152 new Future.of(() { | 152 new Future.sync(() { |
| 153 var clientScript = (message['mode'] == MODE_STATIC) ? | 153 var clientScript = (message['mode'] == MODE_STATIC) ? |
| 154 'static' : 'live-nav'; | 154 'static' : 'live-nav'; |
| 155 var dartPath = pathos.join(message['libPath'], 'lib', '_internal', | 155 var dartPath = pathos.join(message['libPath'], 'lib', '_internal', |
| 156 'dartdoc', 'lib', 'src', 'client', 'client-$clientScript.dart'); | 156 'dartdoc', 'lib', 'src', 'client', 'client-$clientScript.dart'); |
| 157 var jsPath = pathos.join(message['outputDir'], 'client-$clientScript.js'); | 157 var jsPath = pathos.join(message['outputDir'], 'client-$clientScript.js'); |
| 158 | 158 |
| 159 return dart2js.compile( | 159 return dart2js.compile( |
| 160 new Path(dartPath), new Path(message['libPath']), | 160 new Path(dartPath), new Path(message['libPath']), |
| 161 options: const <String>['--categories=Client,Server']).then((jsCode) { | 161 options: const <String>['--categories=Client,Server']).then((jsCode) { |
| 162 writeString(new File(jsPath), jsCode); | 162 writeString(new File(jsPath), jsCode); |
| (...skipping 2150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2313 return ''' | 2313 return ''' |
| 2314 <div class="mdn"> | 2314 <div class="mdn"> |
| 2315 $mdnComment | 2315 $mdnComment |
| 2316 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> | 2316 <div class="mdn-note"><a href="$mdnUrl">from MDN</a></div> |
| 2317 </div> | 2317 </div> |
| 2318 '''; | 2318 '''; |
| 2319 } | 2319 } |
| 2320 | 2320 |
| 2321 String toString() => mdnComment; | 2321 String toString() => mdnComment; |
| 2322 } | 2322 } |
| OLD | NEW |