Skip to content

Create some initial templates for md #2145

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 3 commits into from
Feb 25, 2020
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: 1 addition & 1 deletion lib/src/model/category.dart
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ class Category extends Nameable
@override
String get href => isCanonical ? '${package.baseHref}$filePath' : null;

String get categorization => _categoryRenderer.renderCategoryLabel(this);
String get categoryLabel => _categoryRenderer.renderCategoryLabel(this);

String get linkedName => _categoryRenderer.renderLinkedName(this);

Expand Down
2 changes: 1 addition & 1 deletion lib/templates/html/_categorization.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{{#hasCategoryNames}}
{{#displayedCategories}}
{{{categorization}}}
{{{categoryLabel}}}
{{/displayedCategories}}
{{/hasCategoryNames}}
6 changes: 6 additions & 0 deletions lib/templates/md/404error.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# 404

Oops, something's gone wrong :-(

You've tried to visit a page that doesn't exist. Luckily this site has other
[pages](index.md).
7 changes: 7 additions & 0 deletions lib/templates/md/_accessor_getter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{#getter}}
{{{ linkedReturnType }}} {{>name_summary}}
{{>features}}

{{>documentation}}
{{>source_code}}
{{/getter}}
7 changes: 7 additions & 0 deletions lib/templates/md/_accessor_setter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{#setter}}
{{>name_summary}}({{{ linkedParamsNoMetadata }}})
{{>features}}

{{>documentation}}
{{>source_code}}
{{/setter}}
3 changes: 3 additions & 0 deletions lib/templates/md/_callable.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}}{{{linkedGenericParameters}}}({{{ linkedParamsNoMetadata }}}) {{{ linkedReturnType }}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
{{>features}}
7 changes: 7 additions & 0 deletions lib/templates/md/_callable_multiline.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{#hasAnnotations}}
{{#annotations}}
- {{{.}}}
{{/annotations}}
{{/hasAnnotations}}

{{{ linkedReturnType }}} {{>name_summary}}{{{genericParameters}}}({{#hasParameters}}{{{linkedParamsLines}}}{{/hasParameters}})
5 changes: 5 additions & 0 deletions lib/templates/md/_categorization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{{#hasCategoryNames}}
{{#displayedCategories}}
{{{categoryLabel}}}
{{/displayedCategories}}
{{/hasCategoryNames}}
2 changes: 2 additions & 0 deletions lib/templates/md/_class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}}{{{linkedGenericParameters}}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
3 changes: 3 additions & 0 deletions lib/templates/md/_constant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#isDeprecated}}~~{{/isDeprecated}}{{{ linkedName }}} const {{{ linkedReturnType }}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
{{>features}}
3 changes: 3 additions & 0 deletions lib/templates/md/_documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#hasDocumentation}}
{{{ documentationAsHtml }}}
{{/hasDocumentation}}
2 changes: 2 additions & 0 deletions lib/templates/md/_extension.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
1 change: 1 addition & 0 deletions lib/templates/md/_features.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ #featuresAsString.isNotEmpty }}_{{{featuresAsString}}}_{{ /featuresAsString.isNotEmpty }}
3 changes: 3 additions & 0 deletions lib/templates/md/_footer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{! markdown has no dedicated footer element, so both placeholders are siblings }}
{{! footer-text placeholder }}
{{! footer placeholder }}
1 change: 1 addition & 0 deletions lib/templates/md/_head.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{! header placeholder }}
4 changes: 4 additions & 0 deletions lib/templates/md/_library.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{{{ linkedName }}} ({{>categorization}})
{{#isDocumented}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
{{/isDocumented}}
2 changes: 2 additions & 0 deletions lib/templates/md/_mixin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}}{{{linkedGenericParameters}}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
1 change: 1 addition & 0 deletions lib/templates/md/_name_summary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{#isConst}}const {{/isConst}}{{#isDeprecated}}~~{{/isDeprecated}}{{name}}{{#isDeprecated}}~~{{/isDeprecated}}
3 changes: 3 additions & 0 deletions lib/templates/md/_property.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{{linkedName}}} {{{ arrow }}} {{{ linkedReturnType }}} {{>categorization}}
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
{{>features}}
7 changes: 7 additions & 0 deletions lib/templates/md/_source_code.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{#hasSourceCode}}
## Implementation

```dart
{{{ sourceCode }}}
```
{{/hasSourceCode}}
3 changes: 3 additions & 0 deletions lib/templates/md/_source_link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{#hasSourceHref}}
[source]({{{sourceHref}}})
{{/hasSourceHref}}
81 changes: 81 additions & 0 deletions lib/templates/md/category.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{{>head}}

{{#self}}
# {{name}} {{kind}}

{{>documentation}}

{{#hasPublicLibraries}}
## Libraries

{{#publicLibraries}}
{{>library}}
{{/publicLibraries}}
{{/hasPublicLibraries}}

{{#hasPublicClasses}}
## Classes

{{#publicClasses}}
{{>class}}
{{/publicClasses}}
{{/hasPublicClasses}}

{{#hasPublicMixins}}
## Mixins

{{#publicMixins}}
{{>mixin}}
{{/publicMixins}}
{{/hasPublicMixins}}

{{#hasPublicConstants}}
## Constants

{{#publicConstants}}
{{>constant}}
{{/publicConstants}}
{{/hasPublicConstants}}

{{#hasPublicProperties}}
## Properties

{{#publicProperties}}
{{>property}}
{{/publicProperties}}
{{/hasPublicProperties}}

{{#hasPublicFunctions}}
## Functions

{{#publicFunctions}}
{{>callable}}
{{/publicFunctions}}
{{/hasPublicFunctions}}

{{#hasPublicEnums}}
## Enums

{{#publicEnums}}
{{>class}}
{{/publicEnums}}
{{/hasPublicEnums}}

{{#hasPublicTypedefs}}
## Typedefs

{{#publicTypedefs}}
{{>callable}}
{{/publicTypedefs}}
{{/hasPublicTypedefs}}

{{#hasPublicExceptions}}
## Exceptions / Errors

{{#publicExceptions}}
{{>class}}
{{/publicExceptions}}
{{/hasPublicExceptions}}
{{/self}}

{{>footer}}
124 changes: 124 additions & 0 deletions lib/templates/md/class.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{{>head}}

{{#self}}
# {{{nameWithGenerics}}} {{kind}}

{{>source_link}}
{{>categorization}}
{{/self}}

{{#clazz}}
{{>documentation}}

{{#hasModifiers}}
{{#hasPublicSuperChainReversed}}
**Inheritance**

- {{{linkedObjectType}}}
{{#publicSuperChainReversed}}
- {{{linkedName}}}
{{/publicSuperChainReversed}}
- {{{name}}}
{{/hasPublicSuperChainReversed}}

{{#hasPublicInterfaces}}
**Implemented types**

{{#publicInterfaces}}
- {{{linkedName}}}
{{/publicInterfaces}}
{{/hasPublicInterfaces}}

{{#hasPublicMixins}}
**Mixed in types**

{{#publicMixins}}
- {{{linkedName}}}
{{/publicMixins}}
{{/hasPublicMixins}}

{{#hasPublicImplementors}}
**Implementers**

{{#publicImplementors}}
- {{{linkedName}}}
{{/publicImplementors}}
{{/hasPublicImplementors}}

{{#hasPotentiallyApplicableExtensions}}
**Available Extensions**

{{#potentiallyApplicableExtensions}}
- {{{linkedName}}}
{{/potentiallyApplicableExtensions}}
{{/hasPotentiallyApplicableExtensions}}

{{#hasAnnotations}}
**Annotations**

{{#annotations}}
- {{{.}}}
{{/annotations}}
{{/hasAnnotations}}
{{/hasModifiers}}

{{#hasPublicConstructors}}
## Constructors

{{#publicConstructors}}
{{{linkedName}}} ({{{ linkedParams }}})
: {{{ oneLineDoc }}} {{{ extendedDocLink }}}
{{#isConst}}const{{/isConst}} {{#isFactory}}factory{{/isFactory}}
{{/publicConstructors}}
{{/hasPublicConstructors}}

{{#hasPublicProperties}}
## Properties

{{#allPublicInstanceProperties}}
{{>property}}
{{/allPublicInstanceProperties}}
{{/hasPublicProperties}}

{{#hasPublicMethods}}
## Methods

{{#allPublicInstanceMethods}}
{{>callable}}
{{/allPublicInstanceMethods}}
{{/hasPublicMethods}}

{{#hasPublicOperators}}
## Operators

{{#allPublicOperators}}
{{>callable}}
{{/allPublicOperators}}
{{/hasPublicOperators}}

{{#hasPublicStaticProperties}}
## Static Properties

{{#publicStaticProperties}}
{{>property}}
{{/publicStaticProperties}}
{{/hasPublicStaticProperties}}

{{#hasPublicStaticMethods}}
## Static Methods

{{#publicStaticMethods}}
{{>callable}}
{{/publicStaticMethods}}
{{/hasPublicStaticMethods}}

{{#hasPublicConstants}}
## Constants

{{#publicConstants}}
{{>constant}}
{{/publicConstants}}
{{/hasPublicConstants}}
{{/clazz}}

{{>footer}}
16 changes: 16 additions & 0 deletions lib/templates/md/constant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{{>head}}

{{#self}}
# {{{name}}} {{kind}}

{{>source_link}}
{{/self}}

{{#property}}
{{{ linkedReturnType }}} {{>name_summary}} = {{{ constantValue }}}

{{>documentation}}
{{>source_code}}
{{/property}}

{{>footer}}
25 changes: 25 additions & 0 deletions lib/templates/md/constructor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{>head}}

{{#self}}
# {{{nameWithGenerics}}} {{kind}}

{{>source_link}}
{{/self}}

{{#constructor}}
{{#hasAnnotations}}
{{#annotations}}
- {{{.}}}
{{/annotations}}
{{/hasAnnotations}}

{{#isConst}}const{{/isConst}}
{{#isDeprecated}}~~{{/isDeprecated}}{{{nameWithGenerics}}}({{#hasParameters}}{{{linkedParamsLines}}}{{/hasParameters}}){{#isDeprecated}}~~{{/isDeprecated}}

{{>documentation}}

{{>source_code}}

{{/constructor}}

{{>footer}}
Loading