Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Run `pub global activate dartdoc` to install `dartdoc`.
## 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

Expand All @@ -31,16 +31,16 @@ the issue tracker, start by opening an issue. Thanks!

#### 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)
- `--sdk-docs`
- `--dart-sdk /pathTo/dart-sdk` (optional)

## Issues and bugs

Expand Down
2 changes: 1 addition & 1 deletion bin/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ main(List<String> arguments) async {
: new PackageMeta.fromDir(inputDir);

print("Generating documentation for '${packageMeta}' into "
"${outputDir.absolute.path}${Platform.pathSeparator}.");
"${outputDir.absolute.path}${Platform.pathSeparator}");
print('');

var generators = initGenerators(url, headerFilePath, footerFilePath);
Expand Down
15 changes: 11 additions & 4 deletions lib/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -23,6 +24,9 @@ import 'src/model.dart';
import 'src/model_utils.dart';
import 'src/package_meta.dart';

export 'src/model.dart';
export 'src/package_meta.dart';

const String name = 'dartdoc';
// Update when pubspec version changes.
const String version = '0.0.2+3';
Expand Down Expand Up @@ -55,10 +59,12 @@ class DartDoc {
DartDoc(this.rootDir, this.excludes, this.sdkDir, this.generators,
this.outputDir, this.packageRootDir, this.packageMeta);

/// Generate the documentation. [DartDocResults] is returned if dartdoc
/// succeeds. [DartDocFailure] is thrown if dartdoc fails in an expected way,
/// for instance if there is an anaysis error in the code. Any other exception
/// can be throw if there is an unexpected failure.
/// Generate DartDoc documentation.
///
/// [DartDocResults] is returned if dartdoc succeeds. [DartDocFailure] is
/// thrown if dartdoc fails in an expected way, for example if there is an
/// anaysis error in the code. Any other exception can be throw if there is an
/// unexpected failure.
Future<DartDocResults> generateDocs() async {
_stopwatch = new Stopwatch()..start();

Expand Down Expand Up @@ -168,6 +174,7 @@ class DartDoc {
}
}

/// The results of a [DartDoc.generateDocs] call.
class DartDocResults {
final PackageMeta packageMeta;
final Package package;
Expand Down
4 changes: 3 additions & 1 deletion lib/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ import 'dart:io';
import 'src/model.dart' show Package;

/// An abstract class that defines a generator that generates documentation for
/// a given package. Generators can generate documentation in different formats:
/// a given package.
///
/// Generators can generate documentation in different formats:
/// html, json etc.
abstract class Generator {
/// Generate the documentation for the given package in the specified
Expand Down
7 changes: 2 additions & 5 deletions lib/markdown_processor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
// 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.

library markdown_processor;
/// Utility code to convert markdown comments to html.
library dartdoc.markdown_processor;

import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart'
Expand Down Expand Up @@ -95,10 +96,6 @@ String oneLinerWithoutReferences(String text) {
if (blocks.isEmpty) return '';

String firstPara = new PlainTextRenderer().render([blocks.first]);
if (firstPara.length > 200) {
firstPara = firstPara.substring(0, 200) + '...';
}

return firstPara.trim();
}

Expand Down
12 changes: 8 additions & 4 deletions lib/resource_loader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,15 @@
// 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.

/// 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.

/// Make it possible to load resources, independent of how the Dart app is run.
///
/// Future<String> getTemplateFile(String templatePath) {
/// return loadAsString('package:dartdoc/templates/$templatePath');
/// }
///
/// TODO: consider making this a stand-alone package, if useful
library resource_loader;
library dartdoc.resource_loader;

import 'dart:async' show Future;
import 'dart:io' show Platform, File, Directory;
Expand Down
Loading