From 0d9c01fb25f2dab30a03e556191d551ed81ba048 Mon Sep 17 00:00:00 2001 From: Jonathan Koren Date: Fri, 17 Jan 2020 13:40:25 -0800 Subject: [PATCH 1/3] Create some initial templates for md --- lib/src/model/category.dart | 2 +- lib/templates/html/_categorization.html | 2 +- lib/templates/md/404error.md | 6 ++ lib/templates/md/_accessor_getter.md | 7 ++ lib/templates/md/_accessor_setter.md | 7 ++ lib/templates/md/_callable.md | 3 + lib/templates/md/_callable_multiline.md | 7 ++ lib/templates/md/_categorization.md | 5 + lib/templates/md/_class.md | 2 + lib/templates/md/_constant.md | 3 + lib/templates/md/_documentation.md | 3 + lib/templates/md/_extension.md | 2 + lib/templates/md/_features.md | 1 + lib/templates/md/_head.md | 1 + lib/templates/md/_library.md | 4 + lib/templates/md/_mixin.md | 2 + lib/templates/md/_name_summary.md | 1 + lib/templates/md/_property.md | 3 + lib/templates/md/_source_code.md | 7 ++ lib/templates/md/_source_link.md | 3 + lib/templates/md/category.md | 77 +++++++++++++++ lib/templates/md/class.md | 120 ++++++++++++++++++++++++ lib/templates/md/constant.md | 12 +++ lib/templates/md/constructor.md | 21 +++++ lib/templates/md/enum.md | 113 ++++++++++++++++++++++ lib/templates/md/extension.md | 63 +++++++++++++ lib/templates/md/function.md | 15 +++ lib/templates/md/index.md | 28 ++++++ lib/templates/md/library.md | 82 ++++++++++++++++ lib/templates/md/method.md | 14 +++ lib/templates/md/mixin.md | 120 ++++++++++++++++++++++++ lib/templates/md/property.md | 25 +++++ lib/templates/md/top_level_constant.md | 12 +++ lib/templates/md/top_level_property.md | 22 +++++ lib/templates/md/typedef.md | 13 +++ 35 files changed, 806 insertions(+), 2 deletions(-) create mode 100644 lib/templates/md/404error.md create mode 100644 lib/templates/md/_accessor_getter.md create mode 100644 lib/templates/md/_accessor_setter.md create mode 100644 lib/templates/md/_callable.md create mode 100644 lib/templates/md/_callable_multiline.md create mode 100644 lib/templates/md/_categorization.md create mode 100644 lib/templates/md/_class.md create mode 100644 lib/templates/md/_constant.md create mode 100644 lib/templates/md/_documentation.md create mode 100644 lib/templates/md/_extension.md create mode 100644 lib/templates/md/_features.md create mode 100644 lib/templates/md/_head.md create mode 100644 lib/templates/md/_library.md create mode 100644 lib/templates/md/_mixin.md create mode 100644 lib/templates/md/_name_summary.md create mode 100644 lib/templates/md/_property.md create mode 100644 lib/templates/md/_source_code.md create mode 100644 lib/templates/md/_source_link.md create mode 100644 lib/templates/md/category.md create mode 100644 lib/templates/md/class.md create mode 100644 lib/templates/md/constant.md create mode 100644 lib/templates/md/constructor.md create mode 100644 lib/templates/md/enum.md create mode 100644 lib/templates/md/extension.md create mode 100644 lib/templates/md/function.md create mode 100644 lib/templates/md/index.md create mode 100644 lib/templates/md/library.md create mode 100644 lib/templates/md/method.md create mode 100644 lib/templates/md/mixin.md create mode 100644 lib/templates/md/property.md create mode 100644 lib/templates/md/top_level_constant.md create mode 100644 lib/templates/md/top_level_property.md create mode 100644 lib/templates/md/typedef.md diff --git a/lib/src/model/category.dart b/lib/src/model/category.dart index 5c4992ed1c..b2157cc819 100644 --- a/lib/src/model/category.dart +++ b/lib/src/model/category.dart @@ -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); diff --git a/lib/templates/html/_categorization.html b/lib/templates/html/_categorization.html index 63bab4cc50..0ba248b129 100644 --- a/lib/templates/html/_categorization.html +++ b/lib/templates/html/_categorization.html @@ -1,5 +1,5 @@ {{#hasCategoryNames}} {{#displayedCategories}} - {{{categorization}}} + {{{categoryLabel}}} {{/displayedCategories}} {{/hasCategoryNames}} diff --git a/lib/templates/md/404error.md b/lib/templates/md/404error.md new file mode 100644 index 0000000000..0fedbdcfdd --- /dev/null +++ b/lib/templates/md/404error.md @@ -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). diff --git a/lib/templates/md/_accessor_getter.md b/lib/templates/md/_accessor_getter.md new file mode 100644 index 0000000000..ec5ff77685 --- /dev/null +++ b/lib/templates/md/_accessor_getter.md @@ -0,0 +1,7 @@ +{{#getter}} +{{{ linkedReturnType }}} {{>name_summary}} +{{>features}} + +{{>documentation}} +{{>source_code}} +{{/getter}} diff --git a/lib/templates/md/_accessor_setter.md b/lib/templates/md/_accessor_setter.md new file mode 100644 index 0000000000..896bcbca30 --- /dev/null +++ b/lib/templates/md/_accessor_setter.md @@ -0,0 +1,7 @@ +{{#setter}} +{{>name_summary}}({{{ linkedParamsNoMetadata }}}) +{{>features}} + +{{>documentation}} +{{>source_code}} +{{/setter}} diff --git a/lib/templates/md/_callable.md b/lib/templates/md/_callable.md new file mode 100644 index 0000000000..49d5fdb5f3 --- /dev/null +++ b/lib/templates/md/_callable.md @@ -0,0 +1,3 @@ +{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}}{{{linkedGenericParameters}}}({{{ linkedParamsNoMetadata }}}) {{{ linkedReturnType }}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} +{{>features}} diff --git a/lib/templates/md/_callable_multiline.md b/lib/templates/md/_callable_multiline.md new file mode 100644 index 0000000000..cec0056a7e --- /dev/null +++ b/lib/templates/md/_callable_multiline.md @@ -0,0 +1,7 @@ +{{#hasAnnotations}} +{{#annotations}} +- {{{.}}} +{{/annotations}} +{{/hasAnnotations}} + +{{{ linkedReturnType }}} {{>name_summary}}{{{genericParameters}}}({{#hasParameters}}{{{linkedParamsLines}}}{{/hasParameters}}) diff --git a/lib/templates/md/_categorization.md b/lib/templates/md/_categorization.md new file mode 100644 index 0000000000..53ace95dff --- /dev/null +++ b/lib/templates/md/_categorization.md @@ -0,0 +1,5 @@ +{{#hasCategoryNames}} +{{#displayedCategories}} +{{{categoryLabel}}} +{{/displayedCategories}} +{{/hasCategoryNames}} diff --git a/lib/templates/md/_class.md b/lib/templates/md/_class.md new file mode 100644 index 0000000000..90721f1898 --- /dev/null +++ b/lib/templates/md/_class.md @@ -0,0 +1,2 @@ +{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}}{{{linkedGenericParameters}}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} diff --git a/lib/templates/md/_constant.md b/lib/templates/md/_constant.md new file mode 100644 index 0000000000..54d040ba0d --- /dev/null +++ b/lib/templates/md/_constant.md @@ -0,0 +1,3 @@ +{{#isDeprecated}}~~{{/isDeprecated}}{{{ linkedName }}} const {{{ linkedReturnType }}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} +{{>features}} diff --git a/lib/templates/md/_documentation.md b/lib/templates/md/_documentation.md new file mode 100644 index 0000000000..c3b35dbb40 --- /dev/null +++ b/lib/templates/md/_documentation.md @@ -0,0 +1,3 @@ +{{#hasDocumentation}} +{{{ documentationAsHtml }}} +{{/hasDocumentation}} diff --git a/lib/templates/md/_extension.md b/lib/templates/md/_extension.md new file mode 100644 index 0000000000..097235ead6 --- /dev/null +++ b/lib/templates/md/_extension.md @@ -0,0 +1,2 @@ +{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} diff --git a/lib/templates/md/_features.md b/lib/templates/md/_features.md new file mode 100644 index 0000000000..2083ee0c19 --- /dev/null +++ b/lib/templates/md/_features.md @@ -0,0 +1 @@ +{{ #featuresAsString.isNotEmpty }}_{{{featuresAsString}}}_{{ /featuresAsString.isNotEmpty }} diff --git a/lib/templates/md/_head.md b/lib/templates/md/_head.md new file mode 100644 index 0000000000..c51fcf05ab --- /dev/null +++ b/lib/templates/md/_head.md @@ -0,0 +1 @@ +{{! header placeholder }} diff --git a/lib/templates/md/_library.md b/lib/templates/md/_library.md new file mode 100644 index 0000000000..1ee686691f --- /dev/null +++ b/lib/templates/md/_library.md @@ -0,0 +1,4 @@ +{{{ linkedName }}} ({{>categorization}}) +{{#isDocumented}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} +{{/isDocumented}} diff --git a/lib/templates/md/_mixin.md b/lib/templates/md/_mixin.md new file mode 100644 index 0000000000..90721f1898 --- /dev/null +++ b/lib/templates/md/_mixin.md @@ -0,0 +1,2 @@ +{{#isDeprecated}}~~{{/isDeprecated}}{{{linkedName}}}{{{linkedGenericParameters}}} {{>categorization}}{{#isDeprecated}}~~{{/isDeprecated}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} diff --git a/lib/templates/md/_name_summary.md b/lib/templates/md/_name_summary.md new file mode 100644 index 0000000000..736d3db423 --- /dev/null +++ b/lib/templates/md/_name_summary.md @@ -0,0 +1 @@ +{{#isConst}}const {{/isConst}}{{#isDeprecated}}~~{{/isDeprecated}}{{name}}{{#isDeprecated}}~~{{/isDeprecated}} diff --git a/lib/templates/md/_property.md b/lib/templates/md/_property.md new file mode 100644 index 0000000000..e02f8d5a69 --- /dev/null +++ b/lib/templates/md/_property.md @@ -0,0 +1,3 @@ +{{{linkedName}}} {{{ arrow }}} {{{ linkedReturnType }}} {{>categorization}} +: {{{ oneLineDoc }}} {{{ extendedDocLink }}} +{{>features}} diff --git a/lib/templates/md/_source_code.md b/lib/templates/md/_source_code.md new file mode 100644 index 0000000000..102b07cd4f --- /dev/null +++ b/lib/templates/md/_source_code.md @@ -0,0 +1,7 @@ +{{#hasSourceCode}} +## Implementation + +```dart +{{{ sourceCode }}} +``` +{{/hasSourceCode}} diff --git a/lib/templates/md/_source_link.md b/lib/templates/md/_source_link.md new file mode 100644 index 0000000000..3da6c52df3 --- /dev/null +++ b/lib/templates/md/_source_link.md @@ -0,0 +1,3 @@ +{{#hasSourceHref}} +[source]({{{sourceHref}}}) +{{/hasSourceHref}} diff --git a/lib/templates/md/category.md b/lib/templates/md/category.md new file mode 100644 index 0000000000..fc35f11d01 --- /dev/null +++ b/lib/templates/md/category.md @@ -0,0 +1,77 @@ +{{#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}} diff --git a/lib/templates/md/class.md b/lib/templates/md/class.md new file mode 100644 index 0000000000..661218c441 --- /dev/null +++ b/lib/templates/md/class.md @@ -0,0 +1,120 @@ +{{#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}} diff --git a/lib/templates/md/constant.md b/lib/templates/md/constant.md new file mode 100644 index 0000000000..18b4999398 --- /dev/null +++ b/lib/templates/md/constant.md @@ -0,0 +1,12 @@ +{{#self}} +# {{{name}}} {{kind}} + +{{>source_link}} +{{/self}} + +{{#property}} +{{{ linkedReturnType }}} {{>name_summary}} = {{{ constantValue }}} + +{{>documentation}} +{{>source_code}} +{{/property}} diff --git a/lib/templates/md/constructor.md b/lib/templates/md/constructor.md new file mode 100644 index 0000000000..1f6040356a --- /dev/null +++ b/lib/templates/md/constructor.md @@ -0,0 +1,21 @@ +{{#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}} diff --git a/lib/templates/md/enum.md b/lib/templates/md/enum.md new file mode 100644 index 0000000000..06f66e03c4 --- /dev/null +++ b/lib/templates/md/enum.md @@ -0,0 +1,113 @@ +{{#self}} +# {{{name}}} {{kind}} + +{{>source_link}} +{{>categorization}} +{{/self}} + +{{#eNum}} +{{>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}} + +{{#hasAnnotations}} +**Annotations** + +{{#annotations}} +- {{{.}}} +{{/annotations}} +{{/hasAnnotations}} +{{/hasModifiers}} + +{{#hasPublicConstants}} +## Constants + +{{#publicConstants}} +{{>constant}} +{{/publicConstants}} +{{/hasPublicConstants}} +{{/clazz}} + +{{#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}} +{{/eNum}} diff --git a/lib/templates/md/extension.md b/lib/templates/md/extension.md new file mode 100644 index 0000000000..2df3e14683 --- /dev/null +++ b/lib/templates/md/extension.md @@ -0,0 +1,63 @@ +{{#self}} +# {{{nameWithGenerics}}} {{kind}} + +{{>source_link}} +{{>categorization}} +{{/self}} + +{{#extension}} +{{>documentation}} + +on +{{#extendedType}} +: {{{linkedName}}} +{{/extendedType}} + +{{#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}} +{{/extension}} diff --git a/lib/templates/md/function.md b/lib/templates/md/function.md new file mode 100644 index 0000000000..3d5b4d6757 --- /dev/null +++ b/lib/templates/md/function.md @@ -0,0 +1,15 @@ +{{#self}} +# {{{nameWithGenerics}}} {{kind}} + +{{>source_link}} +{{>categorization}} +{{/self}} + +{{#function}} +{{>callable_multiline}} + +{{>documentation}} + +{{>source_code}} + +{{/function}} diff --git a/lib/templates/md/index.md b/lib/templates/md/index.md new file mode 100644 index 0000000000..028f971718 --- /dev/null +++ b/lib/templates/md/index.md @@ -0,0 +1,28 @@ +# {{ title }} + +{{#packageGraph.defaultPackage}} +{{>documentation}} +{{/packageGraph.defaultPackage}} + +{{#packageGraph}} +{{#localPackages}} +{{#isFirstPackage}} +## Libraries +{{/isFirstPackage}} +{{^isFirstPackage}} +## {{name}} +{{/isFirstPackage}} + +{{#defaultCategory.publicLibraries}} +{{>library}} +{{/defaultCategory.publicLibraries}} + +{{#categoriesWithPublicLibraries}} +### {{name}} + +{{#publicLibraries}} +{{>library}} +{{/publicLibraries}} +{{/categoriesWithPublicLibraries}} +{{/localPackages}} +{{/packageGraph}} diff --git a/lib/templates/md/library.md b/lib/templates/md/library.md new file mode 100644 index 0000000000..ba8426a809 --- /dev/null +++ b/lib/templates/md/library.md @@ -0,0 +1,82 @@ +{{#self}} +# {{{ name }}} {{ kind }} + +{{>source_link}} +{{>categorization}} +{{/self}} + +{{#library}} +{{>documentation}} +{{/library}} + +{{#library.hasPublicClasses}} +## Classes + +{{#library.publicClasses}} +{{>class}} +{{/library.publicClasses}} +{{/library.hasPublicClasses}} + +{{#library.hasPublicMixins}} +## Mixins + +{{#library.publicMixins}} +{{>mixin}} +{{/library.publicMixins}} +{{/library.hasPublicMixins}} + +{{#library.hasPublicExtensions}} +## Extensions + +{{#library.publicExtensions}} +{{>extension}} +{{/library.publicExtensions}} +{{/library.hasPublicExtensions}} + +{{#library.hasPublicConstants}} +## Constants + +{{#library.publicConstants}} +{{>constant}} +{{/library.publicConstants}} +{{/library.hasPublicConstants}} + +{{#library.hasPublicProperties}} +## Properties + +{{#library.publicProperties}} +{{>property}} +{{/library.publicProperties}} +{{/library.hasPublicProperties}} + +{{#library.hasPublicFunctions}} +## Functions + +{{#library.publicFunctions}} +{{>callable}} +{{/library.publicFunctions}} +{{/library.hasPublicFunctions}} + +{{#library.hasPublicEnums}} +## Enums + +{{#library.publicEnums}} +{{>class}} +{{/library.publicEnums}} +{{/library.hasPublicEnums}} + +{{#library.hasPublicTypedefs}} +## Typedefs + +{{#library.publicTypedefs}} +{{>callable}} +{{/library.publicTypedefs}} +{{/library.hasPublicTypedefs}} + +{{#library.hasPublicExceptions}} +## Exceptions / Errors + +{{#library.publicExceptions}} +{{>class}} +{{/library.publicExceptions}} +{{/library.hasPublicExceptions}} diff --git a/lib/templates/md/method.md b/lib/templates/md/method.md new file mode 100644 index 0000000000..4d907c7d72 --- /dev/null +++ b/lib/templates/md/method.md @@ -0,0 +1,14 @@ +{{#self}} +# {{{nameWithGenerics}}} {{kind}} + +{{>source_link}} +{{/self}} + +{{#method}} +{{>callable_multiline}} +{{>features}} +{{>documentation}} + +{{>source_code}} + +{{/method}} diff --git a/lib/templates/md/mixin.md b/lib/templates/md/mixin.md new file mode 100644 index 0000000000..2fbc107264 --- /dev/null +++ b/lib/templates/md/mixin.md @@ -0,0 +1,120 @@ +{{#self}} +# {{{nameWithGenerics}}} {{kind}} + +{{>source_link}} +{{>categorization}} +{{/self}} + +{{#mixin}} +{{>documentation}} + +{{#hasModifiers}} +{{#hasPublicSuperclassConstraints}} +**Superclass Constraints** + +{{#publicSuperclassConstraints}} +- {{{linkedName}}} +{{/publicSuperclassConstraints}} +{{/hasPublicSuperclassConstraints}} + +{{#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}} + +{{#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}} +{{/mixin}} diff --git a/lib/templates/md/property.md b/lib/templates/md/property.md new file mode 100644 index 0000000000..22a04bf2b2 --- /dev/null +++ b/lib/templates/md/property.md @@ -0,0 +1,25 @@ +{{#self}} +# {{name}} {{kind}} + +{{>source_link}} +{{/self}} + +{{#self}} +{{#hasNoGetterSetter}} +{{{ linkedReturnType }}} {{>name_summary}} +{{>features}} + +{{>documentation}} +{{>source_code}} +{{/hasNoGetterSetter}} + +{{#hasGetterOrSetter}} +{{#hasGetter}} +{{>accessor_getter}} +{{/hasGetter}} + +{{#hasSetter}} +{{>accessor_setter}} +{{/hasSetter}} +{{/hasGetterOrSetter}} +{{/self}} diff --git a/lib/templates/md/top_level_constant.md b/lib/templates/md/top_level_constant.md new file mode 100644 index 0000000000..7ff687523b --- /dev/null +++ b/lib/templates/md/top_level_constant.md @@ -0,0 +1,12 @@ +{{#self}} +# {{{name}}} {{kind}} + +{{>source_link}} +{{>categorization}} + +{{>name_summary}} = {{{ constantValue }}} +{{>features}} + +{{>documentation}} +{{>source_code}} +{{/self}} diff --git a/lib/templates/md/top_level_property.md b/lib/templates/md/top_level_property.md new file mode 100644 index 0000000000..114f5ed820 --- /dev/null +++ b/lib/templates/md/top_level_property.md @@ -0,0 +1,22 @@ +{{#self}} +# {{{name}}} {{kind}} + +{{>source_link}} +{{>categorization}} + +{{#hasNoGetterSetter}} +{{{ linkedReturnType }}} {{>name_summary}} +{{>features}} + +{{>documentation}} +{{>source_code}} +{{/hasNoGetterSetter}} + +{{#hasExplicitGetter}} +{{>accessor_getter}} +{{/hasExplicitGetter}} + +{{#hasExplicitSetter}} +{{>accessor_setter}} +{{/hasExplicitSetter}} +{{/self}} diff --git a/lib/templates/md/typedef.md b/lib/templates/md/typedef.md new file mode 100644 index 0000000000..d9f86cf3f4 --- /dev/null +++ b/lib/templates/md/typedef.md @@ -0,0 +1,13 @@ +{{#self}} +# {{{nameWithGenerics}}} {{kind}} + +{{>source_link}} +{{>categorization}} +{{/self}} + +{{#typeDef}} +{{>callable_multiline}} + +{{>documentation}} +{{>source_code}} +{{/typeDef}} From 67377bb6128abe90a9f9f42782dc6f91f82165d4 Mon Sep 17 00:00:00 2001 From: Jonathan Koren Date: Wed, 12 Feb 2020 15:54:47 -0800 Subject: [PATCH 2/3] Add footer, include head and footer in other templates --- lib/templates/md/_footer.md | 3 +++ lib/templates/md/category.md | 4 ++++ lib/templates/md/class.md | 6 +++++- lib/templates/md/constant.md | 4 ++++ lib/templates/md/constructor.md | 4 ++++ lib/templates/md/enum.md | 6 +++++- lib/templates/md/extension.md | 4 ++++ lib/templates/md/function.md | 6 +++++- lib/templates/md/index.md | 4 ++++ lib/templates/md/library.md | 4 ++++ lib/templates/md/method.md | 4 ++++ lib/templates/md/mixin.md | 6 +++++- lib/templates/md/property.md | 4 ++++ lib/templates/md/top_level_constant.md | 6 +++++- lib/templates/md/top_level_property.md | 4 ++++ lib/templates/md/typedef.md | 4 ++++ 16 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 lib/templates/md/_footer.md diff --git a/lib/templates/md/_footer.md b/lib/templates/md/_footer.md new file mode 100644 index 0000000000..3fdd12cb58 --- /dev/null +++ b/lib/templates/md/_footer.md @@ -0,0 +1,3 @@ +{{! markdown has no dedicated footer element, so both placeholders are siblings }} +{{! footer-text placeholder }} +{{! footer placeholder }} diff --git a/lib/templates/md/category.md b/lib/templates/md/category.md index fc35f11d01..ebdddcb91b 100644 --- a/lib/templates/md/category.md +++ b/lib/templates/md/category.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{name}} {{kind}} @@ -75,3 +77,5 @@ {{/publicExceptions}} {{/hasPublicExceptions}} {{/self}} + +{{>footer}} diff --git a/lib/templates/md/class.md b/lib/templates/md/class.md index 661218c441..531f97f4f1 100644 --- a/lib/templates/md/class.md +++ b/lib/templates/md/class.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} @@ -53,7 +55,7 @@ {{#hasAnnotations}} **Annotations** - + {{#annotations}} - {{{.}}} {{/annotations}} @@ -118,3 +120,5 @@ {{/publicConstants}} {{/hasPublicConstants}} {{/clazz}} + +{{>footer}} diff --git a/lib/templates/md/constant.md b/lib/templates/md/constant.md index 18b4999398..689c4c7bad 100644 --- a/lib/templates/md/constant.md +++ b/lib/templates/md/constant.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{name}}} {{kind}} @@ -10,3 +12,5 @@ {{>documentation}} {{>source_code}} {{/property}} + +{{>footer}} diff --git a/lib/templates/md/constructor.md b/lib/templates/md/constructor.md index 1f6040356a..bd50ad17a1 100644 --- a/lib/templates/md/constructor.md +++ b/lib/templates/md/constructor.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} @@ -19,3 +21,5 @@ {{>source_code}} {{/constructor}} + +{{>footer}} diff --git a/lib/templates/md/enum.md b/lib/templates/md/enum.md index 06f66e03c4..735b72752d 100644 --- a/lib/templates/md/enum.md +++ b/lib/templates/md/enum.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{name}}} {{kind}} @@ -45,7 +47,7 @@ {{#hasAnnotations}} **Annotations** - + {{#annotations}} - {{{.}}} {{/annotations}} @@ -111,3 +113,5 @@ {{/publicStaticMethods}} {{/hasPublicStaticMethods}} {{/eNum}} + +{{>footer}} diff --git a/lib/templates/md/extension.md b/lib/templates/md/extension.md index 2df3e14683..ab247ab825 100644 --- a/lib/templates/md/extension.md +++ b/lib/templates/md/extension.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} @@ -61,3 +63,5 @@ on {{/publicConstants}} {{/hasPublicConstants}} {{/extension}} + +{{>footer}} diff --git a/lib/templates/md/function.md b/lib/templates/md/function.md index 3d5b4d6757..63193ff4da 100644 --- a/lib/templates/md/function.md +++ b/lib/templates/md/function.md @@ -1,6 +1,8 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} - + {{>source_link}} {{>categorization}} {{/self}} @@ -13,3 +15,5 @@ {{>source_code}} {{/function}} + +{{>footer}} diff --git a/lib/templates/md/index.md b/lib/templates/md/index.md index 028f971718..1823757785 100644 --- a/lib/templates/md/index.md +++ b/lib/templates/md/index.md @@ -1,3 +1,5 @@ +{{>head}} + # {{ title }} {{#packageGraph.defaultPackage}} @@ -26,3 +28,5 @@ {{/categoriesWithPublicLibraries}} {{/localPackages}} {{/packageGraph}} + +{{>footer}} diff --git a/lib/templates/md/library.md b/lib/templates/md/library.md index ba8426a809..a413873d1d 100644 --- a/lib/templates/md/library.md +++ b/lib/templates/md/library.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{ name }}} {{ kind }} @@ -80,3 +82,5 @@ {{>class}} {{/library.publicExceptions}} {{/library.hasPublicExceptions}} + +{{>footer}} diff --git a/lib/templates/md/method.md b/lib/templates/md/method.md index 4d907c7d72..8868aa318f 100644 --- a/lib/templates/md/method.md +++ b/lib/templates/md/method.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} @@ -12,3 +14,5 @@ {{>source_code}} {{/method}} + +{{>footer}} diff --git a/lib/templates/md/mixin.md b/lib/templates/md/mixin.md index 2fbc107264..6bd7ebfa43 100644 --- a/lib/templates/md/mixin.md +++ b/lib/templates/md/mixin.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} @@ -53,7 +55,7 @@ {{#hasAnnotations}} **Annotations** - + {{#annotations}} - {{{.}}} {{/annotations}} @@ -118,3 +120,5 @@ {{/publicConstants}} {{/hasPublicConstants}} {{/mixin}} + +{{>footer}} diff --git a/lib/templates/md/property.md b/lib/templates/md/property.md index 22a04bf2b2..c3f160be65 100644 --- a/lib/templates/md/property.md +++ b/lib/templates/md/property.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{name}} {{kind}} @@ -23,3 +25,5 @@ {{/hasSetter}} {{/hasGetterOrSetter}} {{/self}} + +{{>footer}} diff --git a/lib/templates/md/top_level_constant.md b/lib/templates/md/top_level_constant.md index 7ff687523b..edb53270d4 100644 --- a/lib/templates/md/top_level_constant.md +++ b/lib/templates/md/top_level_constant.md @@ -1,6 +1,8 @@ +{{>head}} + {{#self}} # {{{name}}} {{kind}} - + {{>source_link}} {{>categorization}} @@ -10,3 +12,5 @@ {{>documentation}} {{>source_code}} {{/self}} + +{{>footer}} diff --git a/lib/templates/md/top_level_property.md b/lib/templates/md/top_level_property.md index 114f5ed820..07cd76e622 100644 --- a/lib/templates/md/top_level_property.md +++ b/lib/templates/md/top_level_property.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{name}}} {{kind}} @@ -20,3 +22,5 @@ {{>accessor_setter}} {{/hasExplicitSetter}} {{/self}} + +{{>footer}} diff --git a/lib/templates/md/typedef.md b/lib/templates/md/typedef.md index d9f86cf3f4..2800d85da7 100644 --- a/lib/templates/md/typedef.md +++ b/lib/templates/md/typedef.md @@ -1,3 +1,5 @@ +{{>head}} + {{#self}} # {{{nameWithGenerics}}} {{kind}} @@ -11,3 +13,5 @@ {{>documentation}} {{>source_code}} {{/typeDef}} + +{{>footer}} From 10740cb860370554ac0afbdeb0224424d1e21f49 Mon Sep 17 00:00:00 2001 From: Jonathan Koren Date: Fri, 14 Feb 2020 08:33:31 -0800 Subject: [PATCH 3/3] Fix in enum template --- lib/templates/md/enum.md | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/templates/md/enum.md b/lib/templates/md/enum.md index 735b72752d..011cf40dab 100644 --- a/lib/templates/md/enum.md +++ b/lib/templates/md/enum.md @@ -61,7 +61,6 @@ {{>constant}} {{/publicConstants}} {{/hasPublicConstants}} -{{/clazz}} {{#hasPublicConstructors}} ## Constructors