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

Unified Diff: dart/utils/dartdoc/interact.dart

Issue 8974006: Modify the dartdoc code rendering. Syntax highlightning (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 years 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 | « dart/utils/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/utils/dartdoc/interact.dart
===================================================================
--- dart/utils/dartdoc/interact.dart (revision 2559)
+++ dart/utils/dartdoc/interact.dart (working copy)
@@ -6,7 +6,11 @@
#library('interact');
#import('dart:html');
+#import('../../frog/lang.dart');
+#import('../markdown/lib.dart', prefix: 'md');
+#source('classify.dart');
+
main() {
window.on.contentLoaded.add((e) {
for (var elem in document.queryAll('.method, .field')) {
@@ -21,9 +25,14 @@
if (pre.classes.contains('expanded')) {
pre.classes.remove('expanded');
} else {
+ // Syntax highlight.
+ if (!pre.classes.contains('formatted')) {
+ pre.innerHTML = classifySource(new SourceFile('', pre.text));
+ pre.classes.add('formatted');
+ };
pre.classes.add('expanded');
}
});
}
});
-}
+}
« no previous file with comments | « dart/utils/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698