From ef48ee0a0a48db132488d1d3939ac36d8249327d Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Fri, 27 Jan 2017 14:51:41 +0000 Subject: [PATCH] build(aio): remove formatting and styles from dgeni templates Much of the formatting was hardcoded and copied from the old anguar.io jade files. This gives us a clean start. Also, more use has been made of include files to make the templates easier to understand and manage. --- docs/templates/README.md | 144 +++++++++++++++ docs/templates/class.template.html | 167 +----------------- docs/templates/decorator.template.html | 45 +---- docs/templates/directive.template.html | 61 +------ docs/templates/function.template.html | 31 +--- docs/templates/includes/_annotations.html | 13 ++ docs/templates/includes/_class-overview.html | 40 +++++ docs/templates/includes/_constructor.html | 16 ++ .../_deprecated-notes.html | 0 docs/templates/includes/_description.html | 9 + docs/templates/includes/_export-as.html | 10 ++ docs/templates/includes/_how-to-use.html | 9 + docs/templates/includes/_info-bar.html | 18 ++ docs/templates/includes/_inputs.html | 13 ++ .../includes/_interface-overview.html | 19 ++ docs/templates/includes/_members.html | 19 ++ docs/templates/includes/_metadata.html | 17 ++ .../{layout => includes}/_ng-module.html | 0 docs/templates/includes/_outputs.html | 13 ++ .../{layout => includes}/_security-notes.html | 0 docs/templates/includes/_selectors.html | 12 ++ docs/templates/includes/_statics.html | 23 +++ docs/templates/includes/_title.html | 6 + docs/templates/includes/_what-it-does.html | 3 + docs/templates/interface.template.html | 74 +------- docs/templates/layout/_how-to-use.html | 10 -- docs/templates/layout/_what-it-does.html | 10 -- docs/templates/layout/api-base.template.html | 11 ++ docs/templates/layout/base.template.html | 5 +- docs/templates/module.template.html | 2 - docs/templates/pipe.template.html | 31 +--- docs/templates/var.template.html | 34 +--- 32 files changed, 430 insertions(+), 435 deletions(-) create mode 100644 docs/templates/README.md create mode 100644 docs/templates/includes/_annotations.html create mode 100644 docs/templates/includes/_class-overview.html create mode 100644 docs/templates/includes/_constructor.html rename docs/templates/{layout => includes}/_deprecated-notes.html (100%) create mode 100644 docs/templates/includes/_description.html create mode 100644 docs/templates/includes/_export-as.html create mode 100644 docs/templates/includes/_how-to-use.html create mode 100644 docs/templates/includes/_info-bar.html create mode 100644 docs/templates/includes/_inputs.html create mode 100644 docs/templates/includes/_interface-overview.html create mode 100644 docs/templates/includes/_members.html create mode 100644 docs/templates/includes/_metadata.html rename docs/templates/{layout => includes}/_ng-module.html (100%) create mode 100644 docs/templates/includes/_outputs.html rename docs/templates/{layout => includes}/_security-notes.html (100%) create mode 100644 docs/templates/includes/_selectors.html create mode 100644 docs/templates/includes/_statics.html create mode 100644 docs/templates/includes/_title.html create mode 100644 docs/templates/includes/_what-it-does.html delete mode 100644 docs/templates/layout/_how-to-use.html delete mode 100644 docs/templates/layout/_what-it-does.html create mode 100644 docs/templates/layout/api-base.template.html diff --git a/docs/templates/README.md b/docs/templates/README.md new file mode 100644 index 0000000000..68bed6350b --- /dev/null +++ b/docs/templates/README.md @@ -0,0 +1,144 @@ +This folder contains the dgeni templates that are used to generate the API docs + +Generally there is a template for each docType. Templates can extend and/or include +other templates. Templates can also import macros from other template files. + +# Template inheritance + +When extending a template, parent must declare blocks that can be overridden by the +child. The template extension hierarchy looks like this (with declared blocks in parentheses): + +- layout/base.template.html (base) + - module.template.html + - layout/api-base.template.html (jumpNav, jumpNavLinks, whatItDoes, infoBar, securityConsiderations, deprecationNotes, howToUse, details) + - class.template.html + - directive.template.html + - enum.template.html + - var.template.html + - const.template.html + - let.template.html + - decorator.template.html + - function.template.html + - interface.template.html + - type-alias.template.html + - pipe.template.html + +# Doc Properties + +It is useful to know what properties are available on each doc type when working with the templates. +Here is an overview: + +## class + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented +- members + +## directive + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented +- members + +## enum + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + +## var + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + +## const + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + +## let + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + +## decorator + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented +- members + +## function + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + +## interface + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented +- members + +## type-alias + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + +## pipe + +- docType +- name +- id +- moduleDoc +- path +- description +- notYetDocumented + diff --git a/docs/templates/class.template.html b/docs/templates/class.template.html index dbd548b4f7..307823df42 100644 --- a/docs/templates/class.template.html +++ b/docs/templates/class.template.html @@ -1,161 +1,12 @@ -{% import "lib/githubLinks.html" as github -%} {% import "lib/paramList.html" as params -%} -{% extends 'layout/base.template.html' -%} +{% extends 'layout/api-base.template.html' -%} -{% block body %} - - -{% include "layout/_what-it-does.html" %} - -{% include "layout/_security-notes.html" %} - -{% include "layout/_deprecated-notes.html" %} - -{% include "layout/_how-to-use.html" %} - -
-
-

Class Overview

-
-
- class {$ doc.name $} { - {% if doc.statics.length %} -
- {% for member in doc.statics %}{% if not member.internal %} -
static
-          
-            {$ member.name | indent(6, false) | trim $}
-          
-          
-            {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $}
-          
-      {% endif %}{% endfor %}
-    {% endif %}
-    {% if doc.constructorDoc.name %}
-    
-
-        
-          {$ doc.constructorDoc.name $}
-        
-        
-          {$ params.paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $}
-        
-    {% endif %}
-    {% if doc.members.length %}
-    
- {% for member in doc.members %}{% if not member.internal %} -
-          
-            {$ member.name | indent(6, false) | trim $}
-          
-          {$ params.paramList(member.parameters) | indent(8, false) | trim $}{$ params.returnType(member.returnType) $}
-        
- {% endif %}{% endfor %} - {% endif %} -

- } -

- -{% block additional %} -{% endblock %} - -
-
-

Class Description

-
- - -{%- if doc.decorators.length %} -{% block annotations %} -
-
-

Annotations

-
-
- {%- for decorator in doc.decorators %} -
-        
-          @{$ decorator.name $}{$ params.paramList(decorator.arguments) | indent(10, false) $}
-        
-      
- {%- if not decorator.notYetDocumented %} - {$ decorator.description | indentForMarkdown(8) | trimBlankLines | marked $} - {% endif %} - {% endfor %} -
-{% endblock %} -{% endif %} - -{%- if doc.constructorDoc and not doc.constructorDoc.internal %} -
-
-

Constructor

-
-
- -
-      
-        {$ doc.constructorDoc.name $}{$ params.paramList(doc.constructorDoc.parameters) | indent(8, false) | trim $}
-      
-    
- {%- if not doc.constructorDoc.notYetDocumented %} - {$ doc.constructorDoc.description | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines | marked $} - {% endif %} -{% endif %} - -{% if doc.statics.length %} -
-
-

Static Members

-
-