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

Side by Side Diff: pkg/dartdoc/lib/dartdoc.dart

Issue 11260045: Add logic to exclude certain libraries from API doc. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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 | « no previous file | utils/apidoc/apidoc.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) 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 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 /** 261 /**
262 * Returns `true` if [library] is included in the generated documentation. 262 * Returns `true` if [library] is included in the generated documentation.
263 */ 263 */
264 bool shouldIncludeLibrary(LibraryMirror library) { 264 bool shouldIncludeLibrary(LibraryMirror library) {
265 if (shouldLinkToPublicApi(library)) { 265 if (shouldLinkToPublicApi(library)) {
266 return false; 266 return false;
267 } 267 }
268 var includeByDefault = true; 268 var includeByDefault = true;
269 String libraryName = displayName(library); 269 String libraryName = displayName(library);
270 if (excludedLibraries.contains(libraryName)) {
271 return false;
272 }
270 if (!includedLibraries.isEmpty) { 273 if (!includedLibraries.isEmpty) {
271 includeByDefault = false; 274 includeByDefault = false;
272 if (includedLibraries.indexOf(libraryName) != -1) { 275 if (includedLibraries.contains(libraryName)) {
273 return true; 276 return true;
274 } 277 }
275 } 278 }
276 if (excludedLibraries.indexOf(libraryName) != -1) {
277 return false;
278 }
279 if (libraryName.startsWith('dart:')) { 279 if (libraryName.startsWith('dart:')) {
280 String suffix = libraryName.substring('dart:'.length); 280 String suffix = libraryName.substring('dart:'.length);
281 LibraryInfo info = LIBRARIES[suffix]; 281 LibraryInfo info = LIBRARIES[suffix];
282 if (info != null) { 282 if (info != null) {
283 return info.documented && includeApi; 283 return info.documented && includeApi;
284 } 284 }
285 } 285 }
286 return includeByDefault; 286 return includeByDefault;
287 } 287 }
288 288
(...skipping 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1857 final InterfaceMirror inheritedFrom; 1857 final InterfaceMirror inheritedFrom;
1858 1858
1859 DocComment(this.text, [this.inheritedFrom = null]) { 1859 DocComment(this.text, [this.inheritedFrom = null]) {
1860 assert(text != null && !text.trim().isEmpty); 1860 assert(text != null && !text.trim().isEmpty);
1861 } 1861 }
1862 1862
1863 String get html => md.markdownToHtml(text); 1863 String get html => md.markdownToHtml(text);
1864 1864
1865 String toString() => text; 1865 String toString() => text;
1866 } 1866 }
OLDNEW
« no previous file with comments | « no previous file | utils/apidoc/apidoc.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698