| 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 * Library for extracting the documentation comments from files generated by | 6 * Library for extracting the documentation comments from files generated by |
| 7 * the HTML library. The comments are stored in a JSON file. | 7 * the HTML library. The comments are stored in a JSON file. |
| 8 * | 8 * |
| 9 * Comments must be in either the block style with leading *s: | 9 * Comments must be in either the block style with leading *s: |
| 10 * | 10 * |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 var outputStream = jsonFile.openOutputStream(); | 51 var outputStream = jsonFile.openOutputStream(); |
| 52 outputStream.writeString(prettyPrintJson(writeJson)); | 52 outputStream.writeString(prettyPrintJson(writeJson)); |
| 53 | 53 |
| 54 outputStream.onNoPendingWrites = () { | 54 outputStream.onNoPendingWrites = () { |
| 55 completer.complete(_anyErrors); | 55 completer.complete(_anyErrors); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 outputStream.onClosed = () { | 58 outputStream.onClosed = () { |
| 59 completer.complete(_anyErrors); | 59 completer.complete(_anyErrors); |
| 60 }; | 60 }; |
| 61 | 61 |
| 62 outputStream.onError = completer.completeException; | 62 outputStream.onError = completer.completeError; |
| 63 }); | 63 }); |
| 64 | 64 |
| 65 return completer.future; | 65 return completer.future; |
| 66 } | 66 } |
| 67 | 67 |
| 68 | 68 |
| 69 /** | 69 /** |
| 70 * Convert all files on [htmlPath]. | 70 * Convert all files on [htmlPath]. |
| 71 * | 71 * |
| 72 * Returns a future that completes to the converted JSON object. | 72 * Returns a future that completes to the converted JSON object. |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 '${prettyPrintJson(json[key], '$indentation ')}'); | 308 '${prettyPrintJson(json[key], '$indentation ')}'); |
| 309 var recursiveOutput = Strings.join(mapList, ',\n'); | 309 var recursiveOutput = Strings.join(mapList, ',\n'); |
| 310 output = '$indentation{\n' | 310 output = '$indentation{\n' |
| 311 '$recursiveOutput' | 311 '$recursiveOutput' |
| 312 '\n$indentation}'; | 312 '\n$indentation}'; |
| 313 } else { | 313 } else { |
| 314 output = '$indentation${JSON.stringify(json)}'; | 314 output = '$indentation${JSON.stringify(json)}'; |
| 315 } | 315 } |
| 316 return output; | 316 return output; |
| 317 } | 317 } |
| OLD | NEW |