| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 * Generates the complete set of corelib reference documentation. | 6 * Generates the complete set of corelib reference documentation. |
| 7 */ | 7 */ |
| 8 #library('apidoc'); | 8 #library('apidoc'); |
| 9 | 9 |
| 10 #import('html_diff.dart'); | 10 #import('html_diff.dart'); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 153 return ""; | 153 return ""; |
| 154 } | 154 } |
| 155 } | 155 } |
| 156 | 156 |
| 157 /** | 157 /** |
| 158 * Returns additional Markdown-formatted documentation for [type], linking it to | 158 * Returns additional Markdown-formatted documentation for [type], linking it to |
| 159 * the corresponding `dart:html` or `dart:dom` [Type](s). If [type] is not in | 159 * the corresponding `dart:html` or `dart:dom` [Type](s). If [type] is not in |
| 160 * `dart:html` or `dart:dom`, returns no additional documentation. | 160 * `dart:html` or `dart:dom`, returns no additional documentation. |
| 161 */ | 161 */ |
| 162 String getTypeDoc(Type type) { | 162 String getTypeDoc(Type type) { |
| 163 if (_diff.domTypesToHtml.containsKey(type)) { | 163 var types = _diff.domTypesToHtml[type]; |
| 164 var htmlTypes = doc.joinWithCommas( | 164 if (types != null && types.length > 0) { |
| 165 map(_diff.domTypesToHtml[type], _linkType)); | 165 final text = doc.joinWithCommas(map(types, _linkType)); |
| 166 return "_This corresponds to $htmlTypes in the [dart:html](../html.html) " + | 166 return '_This corresponds to $text in the [dart:html](../html.html) ' + |
| 167 "library._"; | 167 'library._'; |
| 168 } else if (_diff.htmlTypesToDom.containsKey(type)) { | |
| 169 var domTypes = doc.joinWithCommas( | |
| 170 map(_diff.htmlTypesToDom[type], _linkType)); | |
| 171 return "_This corresponds to $domTypes in the [dart:dom](../dom.html) " + | |
| 172 "library._"; | |
| 173 } else { | |
| 174 return ""; | |
| 175 } | 168 } |
| 169 |
| 170 types = _diff.htmlTypesToDom[type]; |
| 171 if (types != null && types.length > 0) { |
| 172 final text = doc.joinWithCommas(map(types, _linkType)); |
| 173 return '_This corresponds to $text in the [dart:dom](../dom.html) ' + |
| 174 'library._'; |
| 175 } |
| 176 |
| 177 return ''; |
| 176 } | 178 } |
| OLD | NEW |