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

Unified Diff: tools/dom/docs/lib/docs.dart

Issue 12087003: Fixed some bugs in dom docs and recovered documentation of Canvas stuff. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/dom/docs/docs.json ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/docs/lib/docs.dart
diff --git a/tools/dom/docs/lib/docs.dart b/tools/dom/docs/lib/docs.dart
index 69d9854b4ca35d8a78ecc12d43b28667039101f6..ca2908f0784cef9738994d7d6ac732198ac87fec 100644
--- a/tools/dom/docs/lib/docs.dart
+++ b/tools/dom/docs/lib/docs.dart
@@ -85,7 +85,7 @@ Map _generateJsonFromLibraries(Compilation compilation) {
var libraryJson = {};
var sortedClasses = _sortAndFilterMirrors(
- libMirror.classes.values.toList());
+ libMirror.classes.values.toList(), ignoreDocsEditable: true);
for (ClassMirror classMirror in sortedClasses) {
var classJson = {};
@@ -107,8 +107,10 @@ Map _generateJsonFromLibraries(Compilation compilation) {
}
}
+ // Only include the comment if DocsEditable is set.
var classComment = computeUntrimmedCommentAsList(classMirror);
- if (!classComment.isEmpty) {
+ if (!classComment.isEmpty &&
+ findMetadata(classMirror.metadata, 'DocsEditable') != null) {
classJson.putIfAbsent('comment', () => classComment);
}
if (!membersJson.isEmpty) {
@@ -131,13 +133,19 @@ Map _generateJsonFromLibraries(Compilation compilation) {
return convertedJson;
}
-List<DeclarationMirror> _sortAndFilterMirrors(List<DeclarationMirror> mirrors) {
- // Filter out mirrors that are private, or which are not part of this docs
- // process. That is, ones without the DocsEditable annotation.
+/// Filter out mirrors that are private, or which are not part of this docs
+/// process. That is, ones without the DocsEditable annotation.
+/// If [ignoreDocsEditable] is true, relax the restriction on @DocsEditable.
+/// This is to account for classes that are defined in a template, but whose
+/// members are generated.
+List<DeclarationMirror> _sortAndFilterMirrors(List<DeclarationMirror> mirrors,
+ {ignoreDocsEditable: false}) {
+
var filteredMirrors = mirrors.where((DeclarationMirror c) =>
!domNames(c).isEmpty &&
!c.displayName.startsWith('_') &&
- (findMetadata(c.metadata, 'DocsEditable') != null))
+ (!ignoreDocsEditable ? (findMetadata(c.metadata, 'DocsEditable') != null)
+ : true))
.toList();
filteredMirrors.sort((x, y) =>
« no previous file with comments | « tools/dom/docs/docs.json ('k') | tools/dom/scripts/htmldartgenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698