| 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 * A library for extracting the documentation from the various HTML libraries | 6 * A library for extracting the documentation from the various HTML libraries |
| 7 * ([dart:html], [dart:svg], [dart:web_audio], [dart:indexed_db]) and saving | 7 * ([dart:html], [dart:svg], [dart:web_audio], [dart:indexed_db]) and saving |
| 8 * those documentation comments to a JSON file. | 8 * those documentation comments to a JSON file. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 classMirror.members.values.toList()); | 99 classMirror.members.values.toList()); |
| 100 | 100 |
| 101 var membersJson = {}; | 101 var membersJson = {}; |
| 102 for (var memberMirror in sortedMembers) { | 102 for (var memberMirror in sortedMembers) { |
| 103 var memberDomName = domNames(memberMirror)[0]; | 103 var memberDomName = domNames(memberMirror)[0]; |
| 104 var memberComment = _splitCommentsByNewline( | 104 var memberComment = _splitCommentsByNewline( |
| 105 computeUntrimmedCommentAsList(memberMirror)); | 105 computeUntrimmedCommentAsList(memberMirror)); |
| 106 | 106 |
| 107 // Remove interface name from Dom Name. | 107 // Remove interface name from Dom Name. |
| 108 if (memberDomName.indexOf('.') >= 0) { | 108 if (memberDomName.indexOf('.') >= 0) { |
| 109 memberDomName = memberDomName.slice(memberDomName.indexOf('.') + 1); | 109 memberDomName = |
| 110 memberDomName.substring(memberDomName.indexOf('.') + 1); |
| 110 } | 111 } |
| 111 | 112 |
| 112 if (!memberComment.isEmpty) { | 113 if (!memberComment.isEmpty) { |
| 113 membersJson.putIfAbsent(memberDomName, () => memberComment); | 114 membersJson.putIfAbsent(memberDomName, () => memberComment); |
| 114 } | 115 } |
| 115 } | 116 } |
| 116 | 117 |
| 117 // Only include the comment if DocsEditable is set. | 118 // Only include the comment if DocsEditable is set. |
| 118 var classComment = _splitCommentsByNewline( | 119 var classComment = _splitCommentsByNewline( |
| 119 computeUntrimmedCommentAsList(classMirror)); | 120 computeUntrimmedCommentAsList(classMirror)); |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 for (var s in tags.reflectee.split(',')) { | 184 for (var s in tags.reflectee.split(',')) { |
| 184 domNames.add(s.trim()); | 185 domNames.add(s.trim()); |
| 185 } | 186 } |
| 186 | 187 |
| 187 if (domNames.length == 1 && domNames[0] == 'none') return <String>[]; | 188 if (domNames.length == 1 && domNames[0] == 'none') return <String>[]; |
| 188 return domNames; | 189 return domNames; |
| 189 } else { | 190 } else { |
| 190 return <String>[]; | 191 return <String>[]; |
| 191 } | 192 } |
| 192 } | 193 } |
| OLD | NEW |