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 generate docs for a library, run this script with the path to an | 6 * To generate docs for a library, run this script with the path to an |
7 * entrypoint .dart file, like: | 7 * entrypoint .dart file, like: |
8 * | 8 * |
9 * $ dart dartdoc.dart foo.dart | 9 * $ dart dartdoc.dart foo.dart |
10 * | 10 * |
(...skipping 1601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1612 /** Writes a link to a human-friendly string representation for a type. */ | 1612 /** Writes a link to a human-friendly string representation for a type. */ |
1613 linkToType(ContainerMirror enclosingType, TypeMirror type) { | 1613 linkToType(ContainerMirror enclosingType, TypeMirror type) { |
1614 if (type.isVoid) { | 1614 if (type.isVoid) { |
1615 // Do not generate links for void. | 1615 // Do not generate links for void. |
1616 // TODO(johnniwinter): Generate span for specific style? | 1616 // TODO(johnniwinter): Generate span for specific style? |
1617 write('void'); | 1617 write('void'); |
1618 return; | 1618 return; |
1619 } | 1619 } |
1620 if (type.isDynamic) { | 1620 if (type.isDynamic) { |
1621 // Do not generate links for Dynamic. | 1621 // Do not generate links for Dynamic. |
1622 write('Dynamic'); | 1622 write('dynamic'); |
1623 return; | 1623 return; |
1624 } | 1624 } |
1625 | 1625 |
1626 if (type.isTypeVariable) { | 1626 if (type.isTypeVariable) { |
1627 // If we're using a type parameter within the body of a generic class then | 1627 // If we're using a type parameter within the body of a generic class then |
1628 // just link back up to the class. | 1628 // just link back up to the class. |
1629 write(a(typeUrl(enclosingType), type.simpleName)); | 1629 write(a(typeUrl(enclosingType), type.simpleName)); |
1630 return; | 1630 return; |
1631 } | 1631 } |
1632 | 1632 |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1885 final ClassMirror inheritedFrom; | 1885 final ClassMirror inheritedFrom; |
1886 | 1886 |
1887 DocComment(this.text, [this.inheritedFrom = null]) { | 1887 DocComment(this.text, [this.inheritedFrom = null]) { |
1888 assert(text != null && !text.trim().isEmpty); | 1888 assert(text != null && !text.trim().isEmpty); |
1889 } | 1889 } |
1890 | 1890 |
1891 String get html => md.markdownToHtml(text); | 1891 String get html => md.markdownToHtml(text); |
1892 | 1892 |
1893 String toString() => text; | 1893 String toString() => text; |
1894 } | 1894 } |
OLD | NEW |