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

Unified Diff: utils/dartdoc/dartdoc.dart

Issue 9020028: Hook up favicon, link to main page, and fix process bug. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Respond to review. Created 9 years 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 | « utils/apidoc/static/styles.css ('k') | utils/dartdoc/static/favicon.ico » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/dartdoc/dartdoc.dart
diff --git a/utils/dartdoc/dartdoc.dart b/utils/dartdoc/dartdoc.dart
index 6b06d8329079ae97061a04625004a64995ac4cc3..d837e0c811e00d8c064f6673f9a808233373c710 100644
--- a/utils/dartdoc/dartdoc.dart
+++ b/utils/dartdoc/dartdoc.dart
@@ -18,6 +18,7 @@
#import('../../frog/lang.dart');
#import('../../frog/file_system.dart');
#import('../../frog/file_system_node.dart');
+#import('../../frog/lib/node/node.dart');
#import('markdown.dart', prefix: 'md');
#source('classify.dart');
@@ -47,7 +48,7 @@ void main() {
}
}
- FileSystem files = new NodeFileSystem();
+ final files = new NodeFileSystem();
parseOptions('../../frog', [] /* args */, files);
initializeWorld(files);
@@ -72,6 +73,15 @@ class Dartdoc {
*/
String mainTitle = 'Dart Documentation';
+ /**
+ * The URL that the Dart logo links to. Defaults "index.html", the main
+ * page for the generated docs, but can be anything.
+ */
+ String mainUrl = 'index.html';
+
+ /** Set this to add footer text to each generated page. */
+ String footerText = '';
+
CommentMap _comments;
/** The library that we're currently generating docs for. */
@@ -162,17 +172,15 @@ class Dartdoc {
<!DOCTYPE html>
<html>
<head>
- <meta charset="utf-8">
- <title>$title</title>
- <link rel="stylesheet" type="text/css"
- href="${relativePath('styles.css')}" />
- <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
- <script src="${relativePath('interact.js')}"></script>
+ ''');
+ writeHeadContents(title);
+ write(
+ '''
</head>
<body>
<div class="page">
<div class="header">
- ${a('index.html', '<div class="logo"></div>')}
+ ${a(mainUrl, '<div class="logo"></div>')}
${a('index.html', mainTitle)}
''');
@@ -190,11 +198,26 @@ class Dartdoc {
writeln('<div class="content">');
}
+ writeHeadContents(String title) {
+ writeln(
+ '''
+ <meta charset="utf-8">
+ <title>$title</title>
+ <link rel="stylesheet" type="text/css"
+ href="${relativePath('styles.css')}" />
+ <link href="http://fonts.googleapis.com/css?family=Open+Sans:400,600,700,800" rel="stylesheet" type="text/css">
+ <link rel="shortcut icon" href="${relativePath('favicon.ico')}" />
+ <script src="${relativePath('interact.js')}"></script>
+ ''');
+ }
+
writeFooter() {
writeln(
'''
</div>
- <div class="footer"</div>
+ <div class="clear"></div>
+ </div>
+ <div class="footer">$footerText</div>
</body></html>
''');
}
« no previous file with comments | « utils/apidoc/static/styles.css ('k') | utils/dartdoc/static/favicon.ico » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698