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

Unified Diff: utils/apidoc/apidoc.dart

Issue 10915125: Allow apidoc to skip MDN database.json entries that are bogus. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 3 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 | utils/apidoc/mdn/README.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/apidoc.dart
===================================================================
--- utils/apidoc/apidoc.dart (revision 11909)
+++ utils/apidoc/apidoc.dart (working copy)
@@ -239,6 +239,12 @@
static const disqusShortname = 'dartapidocs';
+ // A set of type names (TypeMirror.simpleName values) to ignore while
+ // looking up information from MDN data. TODO(eub, jacobr): fix up the MDN
+ // import scripts so they run correctly and generate data that doesn't have
+ // any entries that need to be ignored.
+ static Set<String> _mdnTypeNamesToSkip = null;
+
/**
* The URL to the page on MDN that content was pulled from for the current
* type being documented. Will be `null` if the type doesn't use any MDN
@@ -252,6 +258,11 @@
this.mode = mode;
this.generateAppCache = generateAppCache;
+ // Skip bad entries in the checked-in mdn/database.json:
+ // * UnknownElement has a top-level Gecko DOM page in German.
+ if (_mdnTypeNamesToSkip == null)
+ _mdnTypeNamesToSkip = new Set.from(['UnknownElement']);
+
mainTitle = 'Dart API Reference';
mainUrl = 'http://dartlang.org';
@@ -448,6 +459,11 @@
* scraped from MDN.
*/
includeMdnTypeComment(TypeMirror type) {
+ if (_mdnTypeNamesToSkip.contains(type.simpleName)) {
+ print('Skipping MDN type ${type.simpleName}');
+ return null;
+ }
+
var typeString = '';
if (type.library.simpleName == HTML_LIBRARY_NAME) {
// If it's an HTML type, try to map it to a base DOM type so we can find
« no previous file with comments | « no previous file | utils/apidoc/mdn/README.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698