Skip to content

Commit f97fb9f

Browse files
committed
Merge pull request #19 from keertip/init
initial commit to repo
2 parents c5ef777 + 7329fad commit f97fb9f

File tree

6 files changed

+119
-0
lines changed

6 files changed

+119
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
# Don’t commit the following directories created by pub.
22
build/
33
packages/
4+
bin/packages
45
.buildlog
6+
.project
57

68
# Or the files created by dart2js.
79
*.dart.js

LICENSE

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Copyright 2014, the Dart project authors. All rights reserved.
2+
Redistribution and use in source and binary forms, with or without
3+
modification, are permitted provided that the following conditions are
4+
met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#dartdoc
2+
3+
A documentation generator for Dart.
4+
5+
Note: This tool is currently in pre-alpha stage.
6+
7+
Issues and bugs
8+
9+
Please file reports on the [GitHub Issue Tracker](https://github.com/dart-lang/dartdoc/issues).
10+
11+
License
12+
13+
See the LICENSE file for information.

bin/dartdoc.dart

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
import 'dart:io';
6+
7+
import 'package:args/args.dart';
8+
9+
import 'package:dartdoc/dartdoc.dart';
10+
11+
/// Analyzes Dart files and generates a representation of included libraries,
12+
/// classes, and members. Uses the current directory to look for libraries.
13+
void main(List<String> arguments) {
14+
var parser = _createArgsParser();
15+
var results = parser.parse(arguments);
16+
17+
if (results['help']) {
18+
_printUsageAndExit(parser);
19+
}
20+
List<String> excludeLibraries = results['exclude'] == null ?
21+
[] : results['exclude'].split(',');
22+
23+
var currentDir = Directory.current;
24+
new DartDoc(currentDir, excludeLibraries).generate();
25+
}
26+
27+
/// Print help if we are passed the help option or invalid arguments.
28+
void _printUsageAndExit(ArgParser parser) {
29+
print(parser.usage);
30+
print('Usage: dartdoc [OPTIONS]');
31+
exit(0);
32+
}
33+
34+
ArgParser _createArgsParser() {
35+
// TODO: more options to be added
36+
var parser = new ArgParser();
37+
parser.addOption(
38+
'exclude',
39+
help: 'a comma-separated list of library names to ignore');
40+
parser.addFlag('help',
41+
abbr: 'h',
42+
negatable: false,
43+
help: 'show command help');
44+
return parser;
45+
}

lib/dartdoc.dart

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2+
// for details. All rights reserved. Use of this source code is governed by a
3+
// BSD-style license that can be found in the LICENSE file.
4+
5+
library dartdoc;
6+
7+
import 'dart:io';
8+
9+
/// Generates Dart documentation for all public Dart libraries in the given
10+
/// directory.
11+
class DartDoc {
12+
13+
List<String> _excludes;
14+
Directory _rootDir;
15+
16+
DartDoc(this._rootDir,this._excludes);
17+
18+
/// Generate the documentation
19+
void generate() {
20+
print("TODO: impelement doc generation");
21+
}
22+
}
23+

pubspec.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name: dartdoc
2+
version: 0.0.1
3+
author: Dart Team <[email protected]>
4+
description: A documentation generator for Dart.
5+
homepage: https://github.com/dart-lang/dartdoc
6+
dependencies:
7+
analyzer: any
8+
args: any
9+
executables:
10+
dartdoc:

0 commit comments

Comments
 (0)