| 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 * This program reads the HTML libraries from [LIB_PATH] and outputs their | 6 * This program reads the HTML libraries from [LIB_PATH] and outputs their |
| 7 * documentation to [JSON_PATH]. | 7 * documentation to [JSON_PATH]. |
| 8 */ | 8 */ |
| 9 | 9 |
| 10 import 'dart:io'; | 10 import 'dart:io'; |
| 11 import 'dart:async'; | 11 import 'dart:async'; |
| 12 | 12 |
| 13 import 'package:path/path.dart' as path; | 13 import 'package:path/path.dart' as path; |
| 14 | 14 |
| 15 import '../lib/docs.dart'; | 15 import '../lib/docs.dart'; |
| 16 | 16 |
| 17 final String json_path = Platform.script.resolve('../docs.json').toFilePath(); | 17 final String json_path = Platform.script.resolve('../docs.json').toFilePath(); |
| 18 final String lib_uri = Platform.script.resolve('../../../../sdk').toString(); | 18 final String lib_uri = Platform.script.resolve('../../../../sdk').toString(); |
| 19 | 19 |
| 20 main() { | 20 main() { |
| 21 print('Converting HTML docs from $lib_uri to $json_path.'); | 21 print('Converting HTML docs from $lib_uri to $json_path.'); |
| 22 | 22 |
| 23 convert(lib_uri, json_path) | 23 convert(lib_uri, json_path).then((bool anyErrors) { |
| 24 .then((bool anyErrors) { | 24 print('Converted HTML docs ${anyErrors ? "with": "without"}' |
| 25 print('Converted HTML docs ${anyErrors ? "with": "without"}' | |
| 26 ' errors.'); | 25 ' errors.'); |
| 27 }); | 26 }); |
| 28 } | 27 } |
| OLD | NEW |