Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Side by Side Diff: utils/dartdoc/files.dart

Issue 9146016: Add the ability to link to members and constructors of other classes in Dartdoc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Get tests running again. Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « utils/dartdoc/dartdoc.dart ('k') | utils/tests/dartdoc/src/dartdoc_tests.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 // Functions for working with files and paths. 5 // Functions for working with files and paths.
6 6
7 /** The path to the file currently being written to, relative to [outdir]. */ 7 /** The path to the file currently being written to, relative to [outdir]. */
8 String _filePath; 8 String _filePath;
9 9
10 /** The file currently being written to. */ 10 /** The file currently being written to. */
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 /** Gets the URL for the documentation for [type]. */ 62 /** Gets the URL for the documentation for [type]. */
63 typeUrl(Type type) { 63 typeUrl(Type type) {
64 if (type.isTop) return '${sanitize(type.library.name)}.html'; 64 if (type.isTop) return '${sanitize(type.library.name)}.html';
65 // Always get the generic type to strip off any type parameters or arguments. 65 // Always get the generic type to strip off any type parameters or arguments.
66 // If the type isn't generic, genericType returns `this`, so it works for 66 // If the type isn't generic, genericType returns `this`, so it works for
67 // non-generic types too. 67 // non-generic types too.
68 return '${sanitize(type.library.name)}/${type.genericType.name}.html'; 68 return '${sanitize(type.library.name)}/${type.genericType.name}.html';
69 } 69 }
70 70
71 /** Gets the URL for the documentation for [member]. */ 71 /** Gets the URL for the documentation for [member]. */
72 memberUrl(Member member) => '${typeUrl(member.declaringType)}#${member.name}'; 72 memberUrl(Member member) {
73 final typeUrl = typeUrl(member.declaringType);
74 if (!member.isConstructor) return '$typeUrl#${member.name}';
75 if (member.constructorName == '') return '$typeUrl#new:${member.name}';
76 return '$typeUrl#new:${member.name}.${member.constructorName}';
77 }
73 78
74 /** Gets the anchor id for the document for [member]. */ 79 /** Gets the anchor id for the document for [member]. */
75 memberAnchor(Member member) => '${member.name}'; 80 memberAnchor(Member member) => '${member.name}';
OLDNEW
« no previous file with comments | « utils/dartdoc/dartdoc.dart ('k') | utils/tests/dartdoc/src/dartdoc_tests.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698