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

Unified Diff: lib/dartdoc/dartdoc.dart

Issue 10513007: dartdoc: --omit-generation-time flag to exclude generation time from output (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/dartdoc/dartdoc.dart
diff --git a/lib/dartdoc/dartdoc.dart b/lib/dartdoc/dartdoc.dart
index 8e893fef39fc99b2c2977c08bddcd3d6d69f28e3..4c81a36c8befd1cd9462c49506d928ab6e706c6a 100644
--- a/lib/dartdoc/dartdoc.dart
+++ b/lib/dartdoc/dartdoc.dart
@@ -59,6 +59,7 @@ void main() {
int mode;
String outputDir;
bool generateAppCache;
+ bool omitGenerationTime;
Jennifer Messerly 2012/06/04 17:47:01 I almost wonder if this should be showGenerationTi
kevmoo-old 2012/06/04 17:51:40 Easy to change this to a positive value, that defa
for (int i = 0; i < args.length - 1; i++) {
final arg = args[i];
@@ -81,6 +82,10 @@ void main() {
generateAppCache = true;
break;
+ case '--omit-generation-time':
+ omitGenerationTime = true;
+ break;
+
default:
if (arg.startsWith('--out=')) {
outputDir = arg.substring('--out='.length);
@@ -113,6 +118,7 @@ void main() {
if (mode != null) dartdoc.mode = mode;
if (outputDir != null) dartdoc.outputDir = outputDir;
if (generateAppCache != null) dartdoc.generateAppCache = generateAppCache;
+ if (omitGenerationTime != null) dartdoc.omitGenerationTime = omitGenerationTime;
Jennifer Messerly 2012/06/04 17:47:01 We generally try to keep code at 80 cols. I'm not
kevmoo-old 2012/06/04 17:51:40 Understood. Will fix.
cleanOutputDirectory(dartdoc.outputDir);
@@ -255,11 +261,14 @@ class Dartdoc {
String searchResultsUrl = 'results.html';
/** Set this to add footer text to each generated page. */
- String footerText = '';
+ String footerText = null;
/** Set this to add content before the footer */
String preFooterText = '';
+ /** Set this to omit generation timestamp from output */
+ bool omitGenerationTime = false;
+
/**
* From exposes the set of libraries in `world.libraries`. That maps library
* *keys* to [Library] objects. The keys are *not* exactly the same as their
@@ -302,6 +311,24 @@ class Dartdoc {
member: _currentMember));
}
+ String get footerContent(){
+ var footerItems = [];
+ if(!omitGenerationTime) {
+ footerItems.add("This page generated at ${new Date.now()}");
+ }
+ if(footerText != null) {
+ footerItems.add(footerText);
+ }
+ var content = '';
+ for (int i = 0; i < footerItems.length; i++) {
+ if(i > 0){
+ content = content.concat('\n');
+ }
+ content = content.concat('<div>${footerItems[i]}</div>');
+ }
+ return content;
+ }
+
void document([String entrypoint]) {
var oldDietParse = options.dietParse;
try {
@@ -462,8 +489,7 @@ class Dartdoc {
</div>
${preFooterText}
<div class="footer">
- <p>This page generated at ${new Date.now()}</p>
- <div>$footerText</div>
+ $footerContent
</div>
<script async src="${relativePath('$clientScript.js')}"></script>
</body></html>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698