| Index: pkg/dartdoc/lib/dartdoc.dart
|
| diff --git a/pkg/dartdoc/lib/dartdoc.dart b/pkg/dartdoc/lib/dartdoc.dart
|
| index 96db2d96cf850dbe94bb1c13786ba1a3a3dac07a..e8aa075479b03805ca7cc5305a1e1f3c3870f5e6 100644
|
| --- a/pkg/dartdoc/lib/dartdoc.dart
|
| +++ b/pkg/dartdoc/lib/dartdoc.dart
|
| @@ -90,6 +90,15 @@ void cleanOutputDirectory(Path path) {
|
| }
|
|
|
| /**
|
| + * Returns the display name of the library. This is necessary to account for
|
| + * dart: libraries.
|
| + */
|
| +String displayName(LibraryMirror library) {
|
| + var uri = library.uri.toString();
|
| + return uri.startsWith('dart:') ? uri.toString() : library.simpleName;
|
| +}
|
| +
|
| +/**
|
| * Copies all of the files in the directory [from] to [to]. Does *not*
|
| * recursively copy subdirectories.
|
| *
|
| @@ -257,7 +266,7 @@ class Dartdoc {
|
| return false;
|
| }
|
| var includeByDefault = true;
|
| - String libraryName = library.simpleName;
|
| + String libraryName = displayName(library);
|
| if (!includedLibraries.isEmpty) {
|
| includeByDefault = false;
|
| if (includedLibraries.indexOf(libraryName) != -1) {
|
| @@ -283,7 +292,7 @@ class Dartdoc {
|
| */
|
| bool shouldLinkToPublicApi(LibraryMirror library) {
|
| if (linkToApi) {
|
| - String libraryName = library.simpleName;
|
| + String libraryName = displayName(library);
|
| if (libraryName.startsWith('dart:')) {
|
| String suffix = libraryName.substring('dart:'.length);
|
| LibraryInfo info = LIBRARIES[suffix];
|
| @@ -329,8 +338,8 @@ class Dartdoc {
|
| compilation.mirrors.libraries.getValues().filter(
|
| shouldIncludeLibrary));
|
| _sortedLibraries.sort((x, y) {
|
| - return x.simpleName.toUpperCase().compareTo(
|
| - y.simpleName.toUpperCase());
|
| + return displayName(x).toUpperCase().compareTo(
|
| + displayName(y).toUpperCase());
|
| });
|
|
|
| // Generate the docs.
|
| @@ -410,7 +419,7 @@ class Dartdoc {
|
| var data = '';
|
| if (_currentLibrary != null) {
|
| data = '$data data-library='
|
| - '"${md.escapeHtml(_currentLibrary.simpleName)}"';
|
| + '"${md.escapeHtml(displayName(_currentLibrary))}"';
|
| }
|
|
|
| if (_currentType != null) {
|
| @@ -519,7 +528,7 @@ class Dartdoc {
|
| }
|
|
|
| void docIndexLibrary(LibraryMirror library) {
|
| - writeln('<h4>${a(libraryUrl(library), library.simpleName)}</h4>');
|
| + writeln('<h4>${a(libraryUrl(library), displayName(library))}</h4>');
|
| }
|
|
|
| /**
|
| @@ -570,7 +579,7 @@ class Dartdoc {
|
|
|
| void docLibraryNavigationJson(LibraryMirror library, List libraryList) {
|
| var libraryInfo = {};
|
| - libraryInfo[NAME] = library.simpleName;
|
| + libraryInfo[NAME] = displayName(library);
|
| final List members = docMembersJson(library.declaredMembers);
|
| if (!members.isEmpty) {
|
| libraryInfo[MEMBERS] = members;
|
| @@ -655,9 +664,9 @@ class Dartdoc {
|
| write('<h2><div class="icon-library"></div>');
|
|
|
| if ((_currentLibrary == library) && (_currentType == null)) {
|
| - write('<strong>${library.simpleName}</strong>');
|
| + write('<strong>${displayName(library)}</strong>');
|
| } else {
|
| - write('${a(libraryUrl(library), library.simpleName)}');
|
| + write('${a(libraryUrl(library), displayName(library))}');
|
| }
|
| write('</h2>');
|
|
|
| @@ -715,16 +724,16 @@ class Dartdoc {
|
|
|
| void docLibrary(LibraryMirror library) {
|
| if (verbose) {
|
| - print('Library \'${library.simpleName}\':');
|
| + print('Library \'${displayName(library)}\':');
|
| }
|
| _totalLibraries++;
|
| _currentLibrary = library;
|
| _currentType = null;
|
|
|
| startFile(libraryUrl(library));
|
| - writeHeader('${library.simpleName} Library',
|
| - [library.simpleName, libraryUrl(library)]);
|
| - writeln('<h2><strong>${library.simpleName}</strong> library</h2>');
|
| + writeHeader('${displayName(library)} Library',
|
| + [displayName(library), libraryUrl(library)]);
|
| + writeln('<h2><strong>${displayName(library)}</strong> library</h2>');
|
|
|
| // Look for a comment for the entire library.
|
| final comment = getLibraryComment(library);
|
| @@ -813,8 +822,8 @@ class Dartdoc {
|
|
|
| final typeTitle =
|
| '${typeName(type)} ${kind}';
|
| - writeHeader('$typeTitle / ${type.library.simpleName} Library',
|
| - [type.library.simpleName, libraryUrl(type.library),
|
| + writeHeader('$typeTitle / ${displayName(type.library)} Library',
|
| + [displayName(type.library), libraryUrl(type.library),
|
| typeName(type), typeUrl(type)]);
|
| writeln(
|
| '''
|
| @@ -1512,7 +1521,7 @@ class Dartdoc {
|
|
|
| /** Gets the URL to the documentation for [library]. */
|
| String libraryUrl(LibraryMirror library) {
|
| - return '${sanitize(library.simpleName)}.html';
|
| + return '${sanitize(displayName(library))}.html';
|
| }
|
|
|
| /** Gets the URL for the documentation for [type]. */
|
| @@ -1524,7 +1533,7 @@ class Dartdoc {
|
| // Always get the generic type to strip off any type parameters or
|
| // arguments. If the type isn't generic, genericType returns `this`, so it
|
| // works for non-generic types too.
|
| - return '${sanitize(type.library.simpleName)}/'
|
| + return '${sanitize(displayName(type.library))}/'
|
| '${type.declaration.simpleName}.html';
|
| }
|
|
|
|
|