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

Unified Diff: tool/doc.dart

Issue 2180083003: Grinder wrapper for doc generation. (Closed) Base URL: https://github.com/dart-lang/linter.git@master
Patch Set: Created 4 years, 5 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 | tool/grind.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tool/doc.dart
diff --git a/tool/doc.dart b/tool/doc.dart
index c9db839392edd6a3f6b60f9f6a7872d6bc68acd7..a0e192120803215936dae67782bc00f84d5ba602 100644
--- a/tool/doc.dart
+++ b/tool/doc.dart
@@ -24,23 +24,7 @@ void main([List<String> args]) {
}
var outDir = options['out'];
-
- if (outDir != null) {
- Directory d = new Directory(outDir);
- if (!d.existsSync()) {
- print("Directory '${d.path}' does not exist");
- return;
- }
- }
-
- // Generate index
- new Indexer(ruleRegistry).generate(outDir);
-
- // Generate rule files
- rules.forEach((l) => new Generator(l).generate(outDir));
-
- // Generate options samples.
- new OptionsSample(rules).generate(outDir);
+ generateDocs(outDir);
}
const ruleFootMatter = '''
@@ -87,6 +71,25 @@ String get enumerateStyleRules => rules
List<String> get sortedRules => rules.map((r) => r.name).toList()..sort();
+void generateDocs(String outDir) {
+ if (outDir != null) {
+ Directory d = new Directory(outDir);
+ if (!d.existsSync()) {
+ print("Directory '${d.path}' does not exist");
+ return;
+ }
+ }
+
+ // Generate index
+ new Indexer(ruleRegistry).generate(outDir);
+
+ // Generate rule files
+ rules.forEach((l) => new Generator(l).generate(outDir));
+
+ // Generate options samples.
+ new OptionsSample(rules).generate(outDir);
+}
+
void printUsage(ArgParser parser, [String error]) {
var message = 'Generates lint docs.';
if (error != null) {
« no previous file with comments | « no previous file | tool/grind.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698