Chromium Code Reviews| 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 use it, from this directory, run: | 6 * To use it, from this directory, run: |
| 7 * | 7 * |
| 8 * $ ./dartdoc <path to .dart file> | 8 * $ ./dartdoc <path to .dart file> |
| 9 * | 9 * |
| 10 * This will create a "docs" directory with the docs for your libraries. To | 10 * This will create a "docs" directory with the docs for your libraries. To |
| (...skipping 514 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 525 } | 525 } |
| 526 | 526 |
| 527 docTypes(classes, 'Classes'); | 527 docTypes(classes, 'Classes'); |
| 528 docTypes(interfaces, 'Interfaces'); | 528 docTypes(interfaces, 'Interfaces'); |
| 529 docTypes(exceptions, 'Exceptions'); | 529 docTypes(exceptions, 'Exceptions'); |
| 530 | 530 |
| 531 writeFooter(); | 531 writeFooter(); |
| 532 endFile(); | 532 endFile(); |
| 533 | 533 |
| 534 for (final type in library.types.getValues()) { | 534 for (final type in library.types.getValues()) { |
| 535 if (!type.isTop) docType(type); | 535 if (type.isTop) continue; |
| 536 if (type.name.startsWith('_')) continue; | |
|
nweiz
2012/03/15 21:04:43
I personally like using continue here, but isn't i
Bob Nystrom
2012/03/15 22:14:28
I don't think so. I know some people aren't a fan
| |
| 537 docType(type); | |
| 536 } | 538 } |
| 537 } | 539 } |
| 538 | 540 |
| 539 void docTypes(List<Type> types, String header) { | 541 void docTypes(List<Type> types, String header) { |
| 540 if (types.length == 0) return; | 542 if (types.length == 0) return; |
| 541 | 543 |
| 542 writeln('<h3>$header</h3>'); | 544 writeln('<h3>$header</h3>'); |
| 543 | 545 |
| 544 for (final type in types) { | 546 for (final type in types) { |
| 545 writeln( | 547 writeln( |
| (...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1212 | 1214 |
| 1213 return new md.Element.text('code', name); | 1215 return new md.Element.text('code', name); |
| 1214 } | 1216 } |
| 1215 | 1217 |
| 1216 // TODO(rnystrom): Move into SourceSpan? | 1218 // TODO(rnystrom): Move into SourceSpan? |
| 1217 int getSpanColumn(SourceSpan span) { | 1219 int getSpanColumn(SourceSpan span) { |
| 1218 final line = span.file.getLine(span.start); | 1220 final line = span.file.getLine(span.start); |
| 1219 return span.file.getColumn(line, span.start); | 1221 return span.file.getColumn(line, span.start); |
| 1220 } | 1222 } |
| 1221 } | 1223 } |
| OLD | NEW |