tighten whitespaces
diff --git a/README.md b/README.md
index 9f62247..6d7936d 100644
--- a/README.md
+++ b/README.md
@@ -14,7 +14,7 @@
## Running dartdoc
Run `dartdoc` from the root directory of package. By default, the documentation
-is geterated to the `doc/api/` directory.
+is generated to the `doc/api/` directory.
## FAQ
@@ -31,12 +31,12 @@
#### What does the output look like?
-You can see the latest API of `dartdoc`, generated by `dartdoc`,
+You can see the latest API of `dartdoc` - generated by `dartdoc` -
[here](https://dartdoc.firebaseapp.com).
#### Generating documentation for Dart SDK
-If you want to generatr documentation for the SDK, run `dartdoc` with the
+If you want to generate documentation for the SDK, run `dartdoc` with the
following command line arguments:
- `--dart-sdk /pathTo/dart-sdk` (optional)
diff --git a/lib/dartdoc.dart b/lib/dartdoc.dart
index 430be19..84aa5bf 100644
--- a/lib/dartdoc.dart
+++ b/lib/dartdoc.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+/// A documentation generator for Dart.
library dartdoc;
import 'dart:async';
diff --git a/lib/markdown_processor.dart b/lib/markdown_processor.dart
index a82e976..fa0c3f5 100644
--- a/lib/markdown_processor.dart
+++ b/lib/markdown_processor.dart
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+/// Utility code to convert markdown comments to html.
library markdown_processor;
import 'package:analyzer/src/generated/ast.dart';
diff --git a/lib/resource_loader.dart b/lib/resource_loader.dart
index ccd6c88..77168b3 100644
--- a/lib/resource_loader.dart
+++ b/lib/resource_loader.dart
@@ -2,10 +2,10 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// TODO: Consider making this a stand-alone package, if useful.
+
/// Attempts to make it possible to load resources, independent of how the Dart
/// app is run.
-///
-/// TODO: consider making this a stand-alone package, if useful
library resource_loader;
import 'dart:async' show Future;
diff --git a/lib/resources/styles.css b/lib/resources/styles.css
index d1f6ea5..c955896 100644
--- a/lib/resources/styles.css
+++ b/lib/resources/styles.css
@@ -16,8 +16,8 @@
*/
html {
- position:relative;
- min-height:100%;
+ position: relative;
+ min-height: 100%;
}
body {
@@ -51,8 +51,8 @@
header {
background-color: #00BCD4;
- height: 200px;
color: white;
+ /*box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.37);*/
}
header.container-fluid {
@@ -63,7 +63,12 @@
margin: 0;
}
-h1, h2, h3, h4, h5, h6 {
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
font-weight: 300;
margin: 0;
}
@@ -72,10 +77,20 @@
font-size: 32px;
}
+.subtitle {
+ font-size: 16px;
+}
+
p {
margin-bottom: 8px;
}
+p,
+ul,
+li {
+ color: #727272;
+}
+
a {
color: #0097A7;
}
@@ -110,16 +125,18 @@
@media (min-width:970px) and (max-width: 2500px) {
.container {
- width:768px;
+ width: 768px;
}
}
header h1 {
- margin-top: 80px;
+ margin-top: 64px;
font-weight: 400;
}
-header a {
+header a,
+header p,
+header li {
color: white;
}
@@ -138,7 +155,8 @@
section.summary h2 {
color: hsl(0, 0%, 46%);
- margin-bottom: 32px;
+ margin-bottom: 16px;
+ border-bottom: 1px solid #eeeeee;
}
dl.dl-horizontal dt {
@@ -173,6 +191,10 @@
font-style: italic;
}
+.undocumented {
+ font-style: italic;
+}
+
.deprecated {
text-decoration: line-through;
}
@@ -182,18 +204,21 @@
}
footer {
- background-color: #B6B6B6;
padding: 20px;
- position:absolute;
- bottom:0;
- width:100%;
- height:60px;
+ position: absolute;
+ bottom: 0;
+ width: 100%;
+ height: 60px;
}
footer p {
margin: 0;
}
+.copyright a {
+ color: #727272;
+}
+
.markdown h1 {
font-size: 24px;
margin-bottom: 8px;
@@ -201,6 +226,7 @@
.markdown h2 {
font-size: 20px;
+ margin-top: 24px;
margin-bottom: 8px;
}
@@ -237,26 +263,27 @@
}
.multi-line-signature {
- font-size: 18px;
+ font-size: 18px;
}
.breadcrumbs {
- padding: 0;
- margin: 8px 0 8px 0;
+ padding: 0;
+ margin: 8px 0 8px 0;
+ font-size: 16px;
}
.comma-separated {
- list-style: none;
- padding: 0;
- display: inline;
+ list-style: none;
+ padding: 0;
+ display: inline;
}
.comma-separated li {
- display: inline;
+ display: inline;
}
.comma-separated li:after {
- content: ", ";
+ content: ", ";
}
.comma-separated li:last-child:after {
@@ -264,14 +291,11 @@
}
.end-with-period li:last-child:after {
- content: ".";
+ content: ".";
}
-
section {
- margin-bottom: 64px;
- padding-top: 64px;
- border-top: 1px solid #eeeeee;
+ padding-top: 32px;
}
.container > section:first-child {
diff --git a/lib/src/html_generator.dart b/lib/src/html_generator.dart
index fad8d80..e66b925 100644
--- a/lib/src/html_generator.dart
+++ b/lib/src/html_generator.dart
@@ -15,7 +15,7 @@
import 'package_meta.dart';
import '../generator.dart';
import '../markdown_processor.dart';
-import '../resources.g.dart' show resource_names;
+import 'resources.g.dart' as resources;
import '../resource_loader.dart' as loader;
typedef String TemplateRenderer(context,
@@ -203,7 +203,6 @@
Map data = {
'package': package,
'documentation': package.documentation,
- 'oneLineDoc': package.oneLineDoc,
'title': '${package.name} - Dart API docs',
'layoutTitle': _layoutTitle(package.name, package.isSdk ? '' : 'package'),
'metaDescription':
@@ -478,7 +477,7 @@
// TODO: change this to use resource_loader
Future _copyResources() async {
final prefix = 'package:dartdoc/resources/';
- for (var resourcePath in resource_names) {
+ for (var resourcePath in resources.resource_names) {
if (!resourcePath.startsWith(prefix)) {
throw new StateError(
'Resource paths must start with $prefix, encountered $resourcePath');
diff --git a/lib/src/model.dart b/lib/src/model.dart
index dc2e0ed..addfd4f 100644
--- a/lib/src/model.dart
+++ b/lib/src/model.dart
@@ -499,6 +499,8 @@
bool get isInSdk => _library.isInSdk;
+ bool get isNotDocumented => oneLineDoc.isEmpty;
+
List<TopLevelVariable> _getVariables() {
if (_variables != null) return _variables;
diff --git a/lib/resources.g.dart b/lib/src/resources.g.dart
similarity index 100%
rename from lib/resources.g.dart
rename to lib/src/resources.g.dart
diff --git a/lib/templates/_head.html b/lib/templates/_head.html
index 82b0f39..1dea8a7 100644
--- a/lib/templates/_head.html
+++ b/lib/templates/_head.html
@@ -15,7 +15,7 @@
<link rel="stylesheet" href="static-assets/styles.css">
<meta name="description" content="{{ metaDescription }}">
-
+
<!-- Do not remove placeholder -->
<!-- Header Placeholder -->
</head>
@@ -37,7 +37,7 @@
<h1 class="title">
{{{ layoutTitle }}}
</h1>
- <p>
+ <p class="subtitle">
{{{ oneLineDoc }}}
</p>
</div>
diff --git a/lib/templates/index.html b/lib/templates/index.html
index a888042..b137acb 100644
--- a/lib/templates/index.html
+++ b/lib/templates/index.html
@@ -12,10 +12,11 @@
<span class="name {{#isDeprecated}}deprecated{{/isDeprecated}}"><a href="{{nameForFile}}/index.html">{{ name }}</a></span>
</dt>
<dd>
- {{{ oneLineDoc }}}
+ {{#isNotDocumented}}<span class="undocumented">Library not documented.</span>{{/isNotDocumented}}
+ {{{ oneLineDoc }}}
</dd>
{{/package.libraries}}
</dl>
</section>
-{{>footer}}
\ No newline at end of file
+{{>footer}}
diff --git a/tool/grind.dart b/tool/grind.dart
index a32c111..c866a2b 100644
--- a/tool/grind.dart
+++ b/tool/grind.dart
@@ -15,6 +15,8 @@
final Directory docsDir =
new Directory(path.join('${Directory.systemTemp.path}', defaultOutDir));
+final String sep = Platform.pathSeparator;
+
main([List<String> args]) => grind(args);
@Task('Start observatory for a test run')
@@ -130,12 +132,12 @@
throw new StateError('lib/resources directory not found');
}
var outDir = new Directory(path.join('lib'));
- var out = new File(path.join(outDir.path, 'resources.g.dart'));
+ var out = new File(path.join(outDir.path, 'src${sep}resources.g.dart'));
out.createSync(recursive: true);
var buffer = new StringBuffer()
..write('// WARNING: This file is auto-generated.\n\n')
..write('library resources;\n\n')
- ..write('const List<String> RESOURCE_NAMES = const [\n');
+ ..write('const List<String> resource_names = const [\n');
var packagePaths = [];
for (var fileName in listDir(sourcePath, recursive: true)) {
if (!FileSystemEntity.isDirectorySync(fileName)) {