Index: tools/dom/docs/bin/docs.dart |
diff --git a/tools/dom/docs/bin/docs.dart b/tools/dom/docs/bin/docs.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..68c577711c24056cd231e057720db537cb0385ce |
--- /dev/null |
+++ b/tools/dom/docs/bin/docs.dart |
@@ -0,0 +1,31 @@ |
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+/** |
+ * This program reads the HTML libraries from [LIB_PATH] and outputs their |
+ * documentation to [JSON_PATH]. |
+ */ |
+ |
+import 'dart:io'; |
+import 'dart:async'; |
+ |
+import '../lib/docs.dart'; |
+ |
+final Path JSON_PATH = scriptDir.append('../docs.json').canonicalize(); |
blois
2013/01/24 02:28:24
This seems odd- these are masquerading as consts,
Andrei Mouravski
2013/01/24 19:28:51
Done.
|
+final Path LIB_PATH = scriptDir.append('../../../../sdk/').canonicalize(); |
+ |
+main() { |
+ print('Converting HTML docs from $LIB_PATH to $JSON_PATH.'); |
+ |
+ var anyErrors = convert(LIB_PATH, JSON_PATH); |
+ |
+ print('Converted HTML docs ${anyErrors ? "with $anyErrors" : "without"} errors.'); |
Johnni Winther
2013/01/24 09:10:09
Long line.
Andrei Mouravski
2013/01/24 19:28:51
Done.
|
+} |
+ |
+/** |
+ * Gets the full path to the directory containing the entrypoint of the current |
+ * script. |
+ */ |
+Path get scriptDir => |
+ new Path(new Options().script).directoryPath; |