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

Side by Side Diff: lib/dartdoc/dartdoc.dart

Issue 10201012: add appcache generation to apidocs (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: enable doc generation again Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | utils/apidoc/apidoc.dart » ('j') | utils/apidoc/apidoc.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * To generate docs for a library, run this script with the path to an 6 * To generate docs for a library, run this script with the path to an
7 * entrypoint .dart file, like: 7 * entrypoint .dart file, like:
8 * 8 *
9 * $ dart dartdoc.dart foo.dart 9 * $ dart dartdoc.dart foo.dart
10 * 10 *
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 222
223 /* The URL that the embedded search results should be displayed on. */ 223 /* The URL that the embedded search results should be displayed on. */
224 String searchResultsUrl = 'results.html'; 224 String searchResultsUrl = 'results.html';
225 225
226 /** Set this to add footer text to each generated page. */ 226 /** Set this to add footer text to each generated page. */
227 String footerText = ''; 227 String footerText = '';
228 228
229 /** Set this to add content before the footer */ 229 /** Set this to add content before the footer */
230 String preFooterText = ''; 230 String preFooterText = '';
231 231
232 /** Set this to add any attributes to the HTML element */
233 String htmlAttributes = '';
234
232 /** 235 /**
233 * From exposes the set of libraries in `world.libraries`. That maps library 236 * From exposes the set of libraries in `world.libraries`. That maps library
234 * *keys* to [Library] objects. The keys are *not* exactly the same as their 237 * *keys* to [Library] objects. The keys are *not* exactly the same as their
235 * names. This means if we order by key, we won't actually have them sorted 238 * names. This means if we order by key, we won't actually have them sorted
236 * correctly. This list contains the libraries in correct order by their 239 * correctly. This list contains the libraries in correct order by their
237 * *name*. 240 * *name*.
238 */ 241 */
239 List<Library> _sortedLibraries; 242 List<Library> _sortedLibraries;
240 243
241 CommentMap _comments; 244 CommentMap _comments;
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 * ['foo', 'foo.html', 'bar', null] 339 * ['foo', 'foo.html', 'bar', null]
337 * 340 *
338 * It will output: 341 * It will output:
339 * 342 *
340 * <a href="foo.html">foo</a> &rsaquo; bar 343 * <a href="foo.html">foo</a> &rsaquo; bar
341 */ 344 */
342 void writeHeader(String title, List<String> breadcrumbs) { 345 void writeHeader(String title, List<String> breadcrumbs) {
343 write( 346 write(
344 ''' 347 '''
345 <!DOCTYPE html> 348 <!DOCTYPE html>
346 <html> 349 <html${htmlAttributes.trim() == '' ? '' : ' $htmlAttributes'}>
347 <head> 350 <head>
348 '''); 351 ''');
349 writeHeadContents(title); 352 writeHeadContents(title);
350 353
351 // Add data attributes describing what the page documents. 354 // Add data attributes describing what the page documents.
352 var data = ''; 355 var data = '';
353 if (_currentLibrary != null) { 356 if (_currentLibrary != null) {
354 data += ' data-library="${md.escapeHtml(_currentLibrary.name)}"'; 357 data += ' data-library="${md.escapeHtml(_currentLibrary.name)}"';
355 } 358 }
356 359
(...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after
1280 1283
1281 return new md.Element.text('code', name); 1284 return new md.Element.text('code', name);
1282 } 1285 }
1283 1286
1284 // TODO(rnystrom): Move into SourceSpan? 1287 // TODO(rnystrom): Move into SourceSpan?
1285 int getSpanColumn(SourceSpan span) { 1288 int getSpanColumn(SourceSpan span) {
1286 final line = span.file.getLine(span.start); 1289 final line = span.file.getLine(span.start);
1287 return span.file.getColumn(line, span.start); 1290 return span.file.getColumn(line, span.start);
1288 } 1291 }
1289 } 1292 }
OLDNEW
« no previous file with comments | « no previous file | utils/apidoc/apidoc.dart » ('j') | utils/apidoc/apidoc.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698