Skip to content

Commit

Permalink
Merge pull request #134 from keertip/html
Browse files Browse the repository at this point in the history
add sdk info and date to index.html
  • Loading branch information
keertip committed Jan 28, 2015
2 parents 180c6ab + e09df52 commit e3b5e10
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
7 changes: 6 additions & 1 deletion lib/src/html_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ library dartdoc.html_generator;

import 'dart:io';

import 'package:intl/intl.dart';
import 'package:mustache4dart/mustache4dart.dart';

import 'css.dart';
Expand Down Expand Up @@ -56,9 +57,12 @@ body {
}

void generatePackage() {
var date = new DateFormat('MMMM dd yyyy').format(new DateTime.now());
var data = {
'css': _bootstrapCss,
'theme': _bootstrapTheme,
'sdkVersion': package.sdkVersion.trim(),
'date': date,
'packageName': package.name,
'packageDesc': package.description,
'packageVersion': package.version,
Expand Down Expand Up @@ -182,7 +186,8 @@ body {
_html.tag('dt', contents: elements[0].typeName);
_html.startTag('dd');
for (ModelElement e in elements) {
_html.writeln('${createIconFor(e)}${e.createLinkedSummary(_helper)}<br>');
_html.writeln(
'${createIconFor(e)}${e.createLinkedSummary(_helper)}<br>');
}
_html.endTag();
}
Expand Down
2 changes: 2 additions & 0 deletions lib/src/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ class Package {

String get version => _isSdk ? _sdkVersion : getPackageVersion(_rootDirPath);

String get sdkVersion => _sdkVersion;

String get description =>
_isSdk ? 'Dart API Libraries' : getPackageDescription(_rootDirPath);

Expand Down
1 change: 1 addition & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ dependencies:
analyzer: any
args: any
grinder: '>=0.6.0 <0.7.0'
intl: any
logging: any
mustache4dart: '>=1.0.0 <2.0.0'
path: any
Expand Down
19 changes: 17 additions & 2 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,18 @@
<style>
body {
margin: 8px;
margin-bottom: 60px;
}
.footer {
position: absolute;
bottom: 0;
width: 100%;
/* Set the fixed height of the footer here */
height: 60px;
background-color: #f5f5f5;
text-align: center;
vertical-align: center;
}
</style>
</head>

Expand Down Expand Up @@ -46,6 +57,10 @@ <h4>
</div>
</div>
</div>
<footer></footer>
<footer class="footer">
<div class="container">
<p class="text-muted">with SDK Version {{sdkVersion}}, {{date}}</p>
</div>
</footer>
</body>
</html>
</html>

0 comments on commit e3b5e10

Please sign in to comment.