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

Unified Diff: lib/dartdoc/dartdoc.dart

Issue 10540085: Modify apidoc to prefer handwritten HTML5 docs over those in MDN or generated code. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixes from review comments Created 8 years, 6 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 | « no previous file | lib/html/doc/html.dartdoc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dartdoc/dartdoc.dart
diff --git a/lib/dartdoc/dartdoc.dart b/lib/dartdoc/dartdoc.dart
index bc510b17e3cbde9e79c3097f68342cda9f823bc3..e08c76b7484ecfd4850d1b2c2943ae63c3ba9143 100644
--- a/lib/dartdoc/dartdoc.dart
+++ b/lib/dartdoc/dartdoc.dart
@@ -636,10 +636,9 @@ class Dartdoc {
writeln('<h2><strong>${library.name}</strong> library</h2>');
// Look for a comment for the entire library.
- final comment = _comments.findLibrary(library.baseSource);
+ final comment = getLibraryComment(library);
if (comment != null) {
- final html = md.markdownToHtml(comment);
- writeln('<div class="doc">$html</div>');
+ writeln('<div class="doc">$comment</div>');
}
// Document the top-level members.
@@ -1053,6 +1052,17 @@ class Dartdoc {
writeln('</div>');
}
+
+ /** Get the doc comment associated with the given library. */
+ String getLibraryComment(Library library) {
+ // Look for a comment for the entire library.
+ final comment = _comments.findLibrary(library.baseSource);
+ if (comment != null) {
+ return md.markdownToHtml(comment);
+ }
+ return null;
+ }
+
/** Get the doc comment associated with the given type. */
String getTypeComment(Type type) {
String comment = _comments.find(type.span);
« no previous file with comments | « no previous file | lib/html/doc/html.dartdoc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698