Skip to content

change the member generation order #622

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 1 commit into from
Jul 7, 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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ packages
.buildlog
.pub
.idea
.packages
.settings/
.DS_Store

Expand Down
1 change: 1 addition & 0 deletions lib/resources/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ header h1 {
}

header a,
header a:hover,
header p,
header li {
color: white;
Expand Down
28 changes: 22 additions & 6 deletions lib/src/html_generator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,43 @@

library dartdoc.html_generator;

import 'dart:async' show Future;
import 'dart:io';
import 'dart:profiler';
import 'dart:async' show Future;

import 'package:mustache4dart/mustache4dart.dart';
import 'package:path/path.dart' as path;

import 'model.dart';
import 'package_meta.dart';
import 'resources.g.dart' as resources;
import '../generator.dart';
import '../markdown_processor.dart';
import 'resources.g.dart' as resources;
import '../resource_loader.dart' as loader;

typedef String TemplateRenderer(context,
{bool assumeNullNonExistingProperty, bool errorOnMissingProperty});

final UserTag _HTML_GENERATE = new UserTag('HTML GENERATE');

// Generation order for libraries:
// constants
// typedefs
// properties
// functions
// enums
// classes
// exceptions
//
// Generation order for classes:
// constants
// static properties
// static methods
// properties
// constructors
// operators
// methods

class Templates {
TemplateRenderer indexTemplate;
TemplateRenderer libraryTemplate;
Expand Down Expand Up @@ -188,9 +206,8 @@ class HtmlGeneratorInstance {
generateTypeDef(package, lib, typeDef);
});
});
if (_url != null) {
//generateSiteMap();
}

//if (_url != null) generateSiteMap();

await _copyResources();

Expand Down Expand Up @@ -281,7 +298,6 @@ class HtmlGeneratorInstance {
'htmlBase': '..'
};

// TODO: `clazz.href` can be null here.
_build(path.joinAll(clazz.href.split('/')), _templates.classTemplate, data);
}

Expand Down
68 changes: 34 additions & 34 deletions lib/templates/class.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,6 @@
</section>
{{/class.hasModifiers}}

{{#class.hasConstructors}}
<section class="summary" id="constructors">
<h2>Constructors</h2>

<dl class="constructor-summary-list">
{{#class.constructors}}
<dt id="{{htmlId}}" class="callable">
<span class="name">{{{linkedName}}}</span><span class="signature">({{{ linkedParams }}})</span>
</dt>
<dd>
{{#isConst}}
<div class="constructor-modifier">
const
</div>
{{/isConst}}
{{{ oneLineDoc }}}
</dd>
{{/class.constructors}}
</dl>
</section>
{{/class.hasConstructors}}

{{#class.hasConstants}}
<section class="summary" id="constants">
<h2>Constants</h2>
Expand Down Expand Up @@ -118,7 +96,7 @@ <h2>Static Methods</h2>

{{#class.hasProperties}}
<section class="summary" id="instance-properties">
<h2>Instance Properties</h2>
<h2>Properties</h2>

<dl class="properties">
{{#class.instanceProperties}}
Expand All @@ -132,20 +110,27 @@ <h2>Instance Properties</h2>
</section>
{{/class.hasProperties}}

{{#class.hasMethods}}
<section id="instance-methods-summary" class="summary">
<h2>Instance Methods</h2>
<dl class="callables">
{{#class.instanceMethods}}
{{>callable}}
{{/class.instanceMethods}}
{{#class.hasConstructors}}
<section class="summary" id="constructors">
<h2>Constructors</h2>

{{#class.inheritedMethods}}
{{>callable}}
{{/class.inheritedMethods}}
<dl class="constructor-summary-list">
{{#class.constructors}}
<dt id="{{htmlId}}" class="callable">
<span class="name">{{{linkedName}}}</span><span class="signature">({{{ linkedParams }}})</span>
</dt>
<dd>
{{#isConst}}
<div class="constructor-modifier">
const
</div>
{{/isConst}}
{{{ oneLineDoc }}}
</dd>
{{/class.constructors}}
</dl>
</section>
{{/class.hasMethods}}
{{/class.hasConstructors}}

{{#class.hasOperators}}
<section id="operators-summary" class="summary">
Expand All @@ -162,4 +147,19 @@ <h2>Operators</h2>
</section>
{{/class.hasOperators}}

{{#class.hasMethods}}
<section id="instance-methods-summary" class="summary">
<h2>Methods</h2>
<dl class="callables">
{{#class.instanceMethods}}
{{>callable}}
{{/class.instanceMethods}}

{{#class.inheritedMethods}}
{{>callable}}
{{/class.inheritedMethods}}
</dl>
</section>
{{/class.hasMethods}}

{{>footer}}
92 changes: 46 additions & 46 deletions lib/templates/library.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,29 @@
{{>documentation}}
{{/library}}

{{#library.hasClasses}}
<section class="summary" id="classes">
<h2>Classes</h2>
{{#library.hasConstants}}
<section class="summary" id="constants">
<h2>Constants</h2>

<dl>
{{#library.classes}}
<dt id="{{htmlId}}">
<span class="name {{#isDeprecated}}deprecated{{/isDeprecated}}">{{{linkedName}}}</span>
</dt>
<dd>
{{{ oneLineDoc }}}
</dd>
{{/library.classes}}
<dl class="properties">
{{#library.constants}}
{{>constant}}
{{/library.constants}}
</dl>
</section>
{{/library.hasClasses}}
{{/library.hasConstants}}

{{#library.hasEnums}}
<section class="summary" id="enums">
<h2>Enums</h2>
{{#library.hasTypedefs}}
<section class="summary" id="typedefs">
<h2>Typedefs</h2>

<dl class="dl-horizontal">
{{#library.enums}}
<dt id="{{htmlId}}">
{{{linkedName}}}
</dt>
<dd>
{{{ oneLineDoc }}}
</dd>
{{/library.enums}}
<dl class="callables">
{{#library.typedefs}}
{{>callable}}
{{/library.typedefs}}
</dl>
</section>
{{/library.hasEnums}}
{{/library.hasTypedefs}}

{{#library.hasProperties}}
<section class="summary" id="properties">
Expand All @@ -50,18 +40,6 @@ <h2>Properties</h2>
</section>
{{/library.hasProperties}}

{{#library.hasConstants}}
<section class="summary" id="constants">
<h2>Constants</h2>

<dl class="properties">
{{#library.constants}}
{{>constant}}
{{/library.constants}}
</dl>
</section>
{{/library.hasConstants}}

{{#library.hasFunctions}}
<section class="summary" id="functions">
<h2>Functions</h2>
Expand All @@ -74,17 +52,39 @@ <h2>Functions</h2>
</section>
{{/library.hasFunctions}}

{{#library.hasTypedefs}}
<section class="summary" id="typedefs">
<h2>Typedefs</h2>
{{#library.hasEnums}}
<section class="summary" id="enums">
<h2>Enums</h2>

<dl class="callables">
{{#library.typedefs}}
{{>callable}}
{{/library.typedefs}}
<dl class="dl-horizontal">
{{#library.enums}}
<dt id="{{htmlId}}">
{{{linkedName}}}
</dt>
<dd>
{{{ oneLineDoc }}}
</dd>
{{/library.enums}}
</dl>
</section>
{{/library.hasTypedefs}}
{{/library.hasEnums}}

{{#library.hasClasses}}
<section class="summary" id="classes">
<h2>Classes</h2>

<dl>
{{#library.classes}}
<dt id="{{htmlId}}">
<span class="name {{#isDeprecated}}deprecated{{/isDeprecated}}">{{{linkedName}}}</span>
</dt>
<dd>
{{{ oneLineDoc }}}
</dd>
{{/library.classes}}
</dl>
</section>
{{/library.hasClasses}}

{{#library.hasExceptions}}
<section class="summary" id="exceptions">
Expand Down