Skip to content

some whitespace changes #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 2, 2015
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
2 changes: 2 additions & 0 deletions bin/dartdoc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +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 dartdoc.bin;

import 'dart:io';

import 'package:args/args.dart';
Expand Down
4 changes: 2 additions & 2 deletions lib/src/css.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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.

library css;
library dartdoc.css;

import 'dart:io';
import 'dart:convert';
import 'dart:io';

class CSS {

Expand Down
7 changes: 2 additions & 5 deletions lib/src/generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ class HtmlGenerator {

List<Variable> variables = library.getVariables();
List<Accessor> accessors = library.getAccessors();
List<Fnction> functions = library.getFunctions();
List<ModelFunction> functions = library.getFunctions();
List<Typedef> typedefs = library.getTypedefs();
List<Class> types = library.getTypes();

Expand Down Expand Up @@ -245,7 +245,6 @@ class HtmlGenerator {
generateElements(cls.getMethods(), false);
}


void printComments(ModelElement e, [bool indent = true]) {
String comments = e.getDocumentation();
if (comments != null) {
Expand All @@ -263,7 +262,6 @@ class HtmlGenerator {
}
}


void generateElements(List<ModelElement> elements, [bool header = true]) {
if (!elements.isEmpty) {
html.tag('h4', contents: elements[0].typeName);
Expand Down Expand Up @@ -449,7 +447,6 @@ String _getFileNameFor(Library library) {
return '${library.name}.html';
}


class HtmlGeneratorHelper extends Helper {

Package package;
Expand Down Expand Up @@ -485,7 +482,7 @@ class HtmlGeneratorHelper extends Helper {
} else {
String append = '';

if (appendParens && (e is Method || e is Fnction)) {
if (appendParens && (e is Method || e is ModelFunction)) {
append = '()';
}
return "<a href=${createHrefFor(e)}>${htmlEscape(e.name)}$append</a>";
Expand Down
2 changes: 1 addition & 1 deletion lib/src/html_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +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.

library html_gen;
library dartdoc.html_gen;

class HtmlHelper {
StringBuffer buffer = new StringBuffer();
Expand Down
1 change: 0 additions & 1 deletion lib/src/io_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ List<String> findFilesToDocumentInPackage(String packageDir) {
// TODO(janicejl): Remove when Issue(12406) is resolved.
var contents = new File(lib).readAsStringSync();


if (contents.contains(new RegExp('\npart of ')) ||
contents.startsWith(new RegExp('part of '))) {
// logger.warning('Skipping part "$lib". '
Expand Down
14 changes: 5 additions & 9 deletions lib/src/model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ abstract class ModelElement {
return new Class(e, library);
}
if (e is FunctionElement) {
return new Fnction(e, library);
return new ModelFunction(e, library);
}
if (e is FunctionTypeAliasElement) {
return new Typedef(e, library);
Expand Down Expand Up @@ -259,7 +259,7 @@ class Library extends ModelElement {
return elements.map((e) => new Typedef(e, this)).toList();
}

List<Fnction> getFunctions() {
List<ModelFunction> getFunctions() {
List<FunctionElement> elements = [];
elements.addAll(_library.definingCompilationUnit.functions);
for (CompilationUnitElement cu in _library.parts) {
Expand All @@ -268,7 +268,7 @@ class Library extends ModelElement {
elements
..removeWhere(isPrivate)
..sort(elementCompare);
return elements.map((e) => new Fnction(e, this)).toList();
return elements.map((e) => new ModelFunction(e, this)).toList();
}

List<Class> getTypes() {
Expand Down Expand Up @@ -340,10 +340,9 @@ class Class extends ModelElement {
}
}

class ModelFunction extends ModelElement {

class Fnction extends ModelElement {

Fnction(FunctionElement element, Library library) : super(element, library);
ModelFunction(FunctionElement element, Library library) : super(element, library);

FunctionElement get _func => (element as FunctionElement);

Expand All @@ -368,7 +367,6 @@ class Fnction extends ModelElement {
}
}


class Typedef extends ModelElement {

FunctionTypeAliasElement get _typedef => (element as FunctionTypeAliasElement);
Expand Down Expand Up @@ -458,7 +456,6 @@ class Constructor extends ModelElement {
}
}


class Method extends ModelElement {
// MethodElement get _method => (element as MethodElement);

Expand Down Expand Up @@ -570,7 +567,6 @@ class ElementType {
List<ElementType> get typeArguments => (_type as ParameterizedType).typeArguments.map((f) => new ElementType(f, library)).toList();
}


abstract class Helper {
String createLinkedName(ModelElement e, [bool appendParens = false]);
String createLinkedReturnTypeName(ElementType type);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/model_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +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.

library model_utils;
library dartdoc.model_utils;

import 'package:analyzer/src/generated/constant.dart';
import 'package:analyzer/src/generated/element.dart';
Expand Down
2 changes: 1 addition & 1 deletion lib/src/package_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ Map _getPubspec(String directoryName) {

String getPackageDescription(String directoryName) =>
_getPubspec(directoryName)['description'];

String getPackageVersion(String directoryName) =>
_getPubspec(directoryName)['version'];
6 changes: 5 additions & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@ version: 0.0.1
author: Dart Team <[email protected]>
description: A documentation generator for Dart.
homepage: https://github.com/dart-lang/dartdoc

dependencies:
analyzer: any
args: any
bootstrap: any
logging: any
mustache4dart: '>= 1.0.0 < 2.0.0'
path: any
unittest: any
yaml: any

dev_dependencies:
unittest: any

executables:
dartdoc: null
2 changes: 1 addition & 1 deletion templates/sitemap.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
{{#links}}
<url>
<loc>{{url}}/{{name}}</loc>
Expand Down
6 changes: 3 additions & 3 deletions test/template_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ tests() {
expect(sitemap({'links' : [{'name': 'somefile.html'}]}),
'''
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>/somefile.html</loc>
</url>
Expand All @@ -37,7 +37,7 @@ tests() {
expect(sitemap({'links' : [{'name': 'somefile.html'}, {'name': 'asecondfile.html'}]}),
'''
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>/somefile.html</loc>
</url>
Expand All @@ -52,7 +52,7 @@ tests() {
expect(sitemap({'url': 'http://mydoc.com','links' : [{'name': 'somefile.html'}]}),
'''
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>http://mydoc.com/somefile.html</loc>
</url>
Expand Down