@@ -74,15 +74,21 @@ main(List<String> arguments) async {
7474 args['include' ] == null ? [] : args['include' ].split (',' );
7575
7676 String url = args['hosted-url' ];
77- String footerFilePath = _resolveTildePath (args['footer' ]);
78- if (footerFilePath != null && ! new File (footerFilePath).existsSync ()) {
79- print ("Error: unable to locate the file with footer at ${footerFilePath }." );
80- exit (1 );
77+ List <String > footerFilePaths = args['footer' ].map (_resolveTildePath).toList ();
78+ print (footerFilePaths);
79+ for (String footerFilePath in footerFilePaths) {
80+ if (! new File (footerFilePath).existsSync ()) {
81+ print ("Error: unable to locate footer file: ${footerFilePath }." );
82+ exit (1 );
83+ }
8184 }
82- String headerFilePath = _resolveTildePath (args['header' ]);
83- if (headerFilePath != null && ! new File (headerFilePath).existsSync ()) {
84- print ("Error: unable to locate the file with header at ${headerFilePath }." );
85- exit (1 );
85+ List <String > headerFilePaths = args['header' ].map (_resolveTildePath).toList ();
86+ print (headerFilePaths);
87+ for (String headerFilePath in footerFilePaths) {
88+ if (! new File (headerFilePath).existsSync ()) {
89+ print ("Error: unable to locate header file: ${headerFilePath }." );
90+ exit (1 );
91+ }
8692 }
8793
8894 Directory outputDir =
@@ -112,7 +118,7 @@ main(List<String> arguments) async {
112118 print ('' );
113119
114120 var generators = await initGenerators (
115- url, headerFilePath, footerFilePath , args['rel-canonical-prefix' ]);
121+ url, headerFilePaths, footerFilePaths , args['rel-canonical-prefix' ]);
116122
117123 for (var generator in generators) {
118124 generator.onFileCreated.listen (_onProgress);
@@ -163,7 +169,7 @@ ArgParser _createArgsParser() {
163169 parser.addFlag ('version' ,
164170 help: 'Display the version for $name .' , negatable: false );
165171 parser.addFlag ('add-crossdart' ,
166- help: 'Add Crossdart links to the source code pieces' ,
172+ help: 'Add Crossdart links to the source code pieces. ' ,
167173 negatable: false ,
168174 defaultsTo: false );
169175 parser.addOption ('dart-sdk' ,
@@ -181,11 +187,11 @@ ArgParser _createArgsParser() {
181187 parser.addOption ('output' ,
182188 help: 'Path to output directory.' , defaultsTo: defaultOutDir);
183189 parser.addOption ('header' ,
184- help :
185- 'path to file containing HTML text, inserted into the header of every page .' );
190+ allowMultiple : true ,
191+ help : 'path to file containing HTML text.' );
186192 parser.addOption ('footer' ,
187- help :
188- 'path to file containing HTML text, inserted into the footer of every page .' );
193+ allowMultiple : true ,
194+ help : 'path to file containing HTML text.' );
189195 parser.addOption ('exclude' ,
190196 help: 'Comma-separated list of library names to ignore.' );
191197 parser.addOption ('include' ,
@@ -194,9 +200,9 @@ ArgParser _createArgsParser() {
194200 help:
195201 'URL where the docs will be hosted (used to generate the sitemap).' );
196202 parser.addOption ('rel-canonical-prefix' ,
197- help: 'If provided, add a rel="canonical" prefixed with provided value. '
203+ help: 'If provided, add a rel="canonical" prefixed with provided value. \n '
198204 'Consider using if building many versions of the docs for public SEO. '
199- 'Learn more at https://goo.gl/gktN6F' );
205+ 'Learn more at https://goo.gl/gktN6F. ' );
200206 parser.addFlag ('include-source' ,
201207 help: 'If source code blocks should be shown, if they exist.' ,
202208 negatable: true ,
0 commit comments