| 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 * 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 return dirname(new File(new Options().script).fullPathSync()); | 133 return dirname(new File(new Options().script).fullPathSync()); |
| 134 } | 134 } |
| 135 | 135 |
| 136 /** | 136 /** |
| 137 * Deletes and recreates the output directory at [path] if it exists. | 137 * Deletes and recreates the output directory at [path] if it exists. |
| 138 */ | 138 */ |
| 139 void cleanOutputDirectory(String path) { | 139 void cleanOutputDirectory(String path) { |
| 140 final outputDir = new Directory(path); | 140 final outputDir = new Directory(path); |
| 141 if (outputDir.existsSync()) { | 141 if (outputDir.existsSync()) { |
| 142 outputDir.deleteRecursivelySync(); | 142 outputDir.deleteRecursivelySync(); |
| 143 outputDir.createSync(); | |
| 144 } | 143 } |
| 144 |
| 145 outputDir.createSync(); |
| 145 } | 146 } |
| 146 | 147 |
| 147 /** | 148 /** |
| 148 * Copies all of the files in the directory [from] to [to]. Does *not* | 149 * Copies all of the files in the directory [from] to [to]. Does *not* |
| 149 * recursively copy subdirectories. | 150 * recursively copy subdirectories. |
| 150 * | 151 * |
| 151 * Note: runs asynchronously, so you won't see any files copied until after the | 152 * Note: runs asynchronously, so you won't see any files copied until after the |
| 152 * event loop has had a chance to pump (i.e. after `main()` has returned). | 153 * event loop has had a chance to pump (i.e. after `main()` has returned). |
| 153 */ | 154 */ |
| 154 void copyFiles(String from, String to) { | 155 void copyFiles(String from, String to) { |
| (...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 | 1278 |
| 1278 return new md.Element.text('code', name); | 1279 return new md.Element.text('code', name); |
| 1279 } | 1280 } |
| 1280 | 1281 |
| 1281 // TODO(rnystrom): Move into SourceSpan? | 1282 // TODO(rnystrom): Move into SourceSpan? |
| 1282 int getSpanColumn(SourceSpan span) { | 1283 int getSpanColumn(SourceSpan span) { |
| 1283 final line = span.file.getLine(span.start); | 1284 final line = span.file.getLine(span.start); |
| 1284 return span.file.getColumn(line, span.start); | 1285 return span.file.getColumn(line, span.start); |
| 1285 } | 1286 } |
| 1286 } | 1287 } |
| OLD | NEW |