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

Unified Diff: utils/apidoc/apidoc.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « lib/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/apidoc/apidoc.dart
diff --git a/utils/apidoc/apidoc.dart b/utils/apidoc/apidoc.dart
index 2d8aaf9b74c0c907a3412b98fd845cab45169a78..5db70df490def61428ef00c2b2ce794c72cd3644 100644
--- a/utils/apidoc/apidoc.dart
+++ b/utils/apidoc/apidoc.dart
@@ -109,6 +109,9 @@ void main() {
print('Generating docs...');
final apidoc = new Apidoc(mdn, outputDir, mode);
apidoc.document();
+
+ print('Building App Cache manifest');
+ apidoc.generateAppCacheManifest();
}
class Apidoc extends doc.Dartdoc {
@@ -173,6 +176,8 @@ class Apidoc extends doc.Dartdoc {
</div> <!-- #comments -->
''';
+ htmlAttributes = 'manifest="appcache.manifest"';
Bob Nystrom 2012/04/24 16:30:33 Is there any reason we wouldn't want dartdoc itsel
sethladd 2012/04/25 21:13:46 moved to dartdoc
+
searchEngineId = '011220921317074318178:i4mscbaxtru';
searchResultsUrl = 'http://www.dartlang.org/search.html';
}
@@ -495,4 +500,22 @@ class Apidoc extends doc.Dartdoc {
return '';
}
+
+ generateAppCacheManifest() {
+ var manifestFile = new File('docs/appcache.manifest');
Bob Nystrom 2012/04/24 16:30:33 The Dartdoc class has a more pleasant API for writ
sethladd 2012/04/25 21:13:46 current way works, will leave for now.
+ var writer = manifestFile.openOutputStream(FileMode.WRITE);
+ writer.writeString("CACHE MANIFEST\n\n");
+ writer.writeString("# VERSION: ${new Date.now()}\n\n");
+ writer.writeString("NETWORK:\n*\n\n");
+ writer.writeString("CACHE:\n");
+ var toCache = new Directory(outputDir);
+ var pathPrefix = new File(outputDir).fullPathSync();
+ var pathPrefixLength = pathPrefix.length;
+ toCache.list(recursive: true);
+ toCache.onFile = (filename) {
+ var relativePath = filename.substring(pathPrefixLength+1);
Bob Nystrom 2012/04/24 16:30:33 Spaces around +
sethladd 2012/04/25 21:13:46 Done.
+ writer.writeString("$relativePath\n");
+ };
+ toCache.onDone = (done) => writer.close();
Bob Nystrom 2012/04/24 16:30:33 Ugh, async. I wonder if at some point, Dartdoc wil
sethladd 2012/04/25 21:13:46 See the added Futures.
+ }
}
« no previous file with comments | « lib/dartdoc/dartdoc.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698