| 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 * This library is used to convert data from a map to a YAML string. | 6 * This library is used to convert data from a map to a YAML string. |
| 7 */ | 7 */ |
| 8 library dart2yaml; | 8 library docgen.dart2yaml; |
| 9 | 9 |
| 10 /** | 10 /** |
| 11 * Gets a String representing the input Map in YAML format. | 11 * Gets a String representing the input Map in YAML format. |
| 12 */ | 12 */ |
| 13 String getYamlString(Map documentData) { | 13 String getYamlString(Map documentData) { |
| 14 StringBuffer yaml = new StringBuffer(); | 14 StringBuffer yaml = new StringBuffer(); |
| 15 _addLevel(yaml, documentData, 0); | 15 _addLevel(yaml, documentData, 0); |
| 16 return yaml.toString(); | 16 return yaml.toString(); |
| 17 } | 17 } |
| 18 | 18 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 /** | 76 /** |
| 77 * Based on the depth in the file, this function returns the correct spacing | 77 * Based on the depth in the file, this function returns the correct spacing |
| 78 * for an element in the YAML output. | 78 * for an element in the YAML output. |
| 79 */ | 79 */ |
| 80 void _calcSpaces(int spaceLevel, StringBuffer yaml) { | 80 void _calcSpaces(int spaceLevel, StringBuffer yaml) { |
| 81 for (int i = 0; i < spaceLevel; i++) { | 81 for (int i = 0; i < spaceLevel; i++) { |
| 82 yaml.write(" "); | 82 yaml.write(" "); |
| 83 } | 83 } |
| 84 } | 84 } |
| OLD | NEW |