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

Unified Diff: pkg/analysis_server/tool/spec/to_html.dart

Issue 2521433002: Regen the analysis server spec to include the diagnostic domain. (Closed)
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analysis_server/tool/spec/spec_input.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/to_html.dart
diff --git a/pkg/analysis_server/tool/spec/to_html.dart b/pkg/analysis_server/tool/spec/to_html.dart
index b17cdfe178d2958831d59827b21497f932bfcf08..d71fa64f1b68a595698245edccd32cf5aca7bddd 100644
--- a/pkg/analysis_server/tool/spec/to_html.dart
+++ b/pkg/analysis_server/tool/spec/to_html.dart
@@ -116,9 +116,6 @@ a:focus, a:hover {
/* Styles for index */
-.subindex {
-}
-
.subindex ul {
padding-left: 0;
margin-left: 0;
@@ -196,6 +193,7 @@ abstract class HtmlMixin {
void head(void callback()) => element('head', {}, callback);
void html(void callback()) => element('html', {}, callback);
void i(void callback()) => element('i', {}, callback);
+ void li(void callback()) => element('li', {}, callback);
void link(String id, void callback()) {
element('a', {'href': '#$id'}, callback);
}
@@ -204,6 +202,7 @@ abstract class HtmlMixin {
void pre(void callback()) => element('pre', {}, callback);
void title(void callback()) => element('title', {}, callback);
void tt(void callback()) => element('tt', {}, callback);
+ void ul(void callback()) => element('ul', {}, callback);
}
/**
@@ -270,6 +269,22 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
}
}
+ void generateTableOfContents() {
+ ul(() {
+ writeln();
+
+ for (var domain in api.domains.where((domain) => !domain.experimental)) {
+ write(' ');
+ li(() {
+ link('domain_${domain.name}', () {
+ write(_toTitleCase(domain.name));
+ });
+ });
+ writeln();
+ }
+ });
+ }
+
void generateIndex() {
h3(() => write('Domains'));
for (var domain in api.domains) {
@@ -425,6 +440,9 @@ class ToHtmlVisitor extends HierarchicalApiVisitor
case 'version':
translateHtml(node, squashParagraphs: squashParagraphs);
break;
+ case 'toc':
+ generateTableOfContents();
+ break;
case 'index':
generateIndex();
break;
@@ -769,3 +787,8 @@ class TypeVisitor extends HierarchicalApiVisitor
}
}
}
+
+String _toTitleCase(String str) {
+ if (str.isEmpty) return str;
+ return str.substring(0, 1).toUpperCase() + str.substring(1);
+}
« no previous file with comments | « pkg/analysis_server/tool/spec/spec_input.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698