@@ -10,7 +10,6 @@ import 'dart:io' show Directory;
10
10
import 'dart:isolate' ;
11
11
12
12
import 'package:dartdoc/src/dartdoc_options.dart' ;
13
- import 'package:dartdoc/src/html/html_generator.dart' ;
14
13
import 'package:dartdoc/src/model/model.dart' show PackageGraph;
15
14
import 'package:dartdoc/src/package_meta.dart' ;
16
15
@@ -33,7 +32,7 @@ abstract class Generator {
33
32
}
34
33
35
34
/// Dartdoc options related to generators generally.
36
- mixin BaseGeneratorContext on DartdocOptionContextBase {
35
+ mixin GeneratorContext on DartdocOptionContextBase {
37
36
List <String > get footer => optionSet['footer' ].valueAt (context);
38
37
39
38
/// _footerText is only used to construct synthetic options.
@@ -47,6 +46,11 @@ mixin BaseGeneratorContext on DartdocOptionContextBase {
47
46
48
47
bool get prettyIndexJson => optionSet['prettyIndexJson' ].valueAt (context);
49
48
49
+ String get favicon => optionSet['favicon' ].valueAt (context);
50
+
51
+ String get relCanonicalPrefix =>
52
+ optionSet['relCanonicalPrefix' ].valueAt (context);
53
+
50
54
String get templatesDir => optionSet['templatesDir' ].valueAt (context);
51
55
}
52
56
@@ -106,6 +110,15 @@ Future<List<DartdocOption>> createGeneratorOptions() async {
106
110
'Generates `index.json` with indentation and newlines. The file is '
107
111
'larger, but it\' s also easier to diff.' ,
108
112
negatable: false ),
113
+ DartdocOptionArgFile <String >('favicon' , null ,
114
+ isFile: true ,
115
+ help: 'A path to a favicon for the generated docs.' ,
116
+ mustExist: true ),
117
+ DartdocOptionArgOnly <String >('relCanonicalPrefix' , null ,
118
+ help:
119
+ 'If provided, add a rel="canonical" prefixed with provided value. '
120
+ 'Consider using if building many versions of the docs for public '
121
+ 'SEO; learn more at https://goo.gl/gktN6F.' ),
109
122
DartdocOptionArgOnly <String >("templatesDir" , null ,
110
123
isDir: true ,
111
124
mustExist: true ,
@@ -119,5 +132,5 @@ Future<List<DartdocOption>> createGeneratorOptions() async {
119
132
'they must begin with an underscore, and references to them must '
120
133
'omit the leading underscore (e.g. use {{>foo}} to reference the '
121
134
'partial template _foo.html).' ),
122
- ].. addAll ( createHtmlGeneratorOptions ()) ;
135
+ ];
123
136
}
0 commit comments