From 63fa941e1101f06fa5d7365395f980391a0f352e Mon Sep 17 00:00:00 2001 From: mhartington Date: Thu, 3 Dec 2015 17:46:57 -0500 Subject: [PATCH] docs(): template refactor --- scripts/docs/templates/common.template.html | 121 ++++++++++++-------- 1 file changed, 71 insertions(+), 50 deletions(-) diff --git a/scripts/docs/templates/common.template.html b/scripts/docs/templates/common.template.html index 8528a6a1b4..8a72532a35 100644 --- a/scripts/docs/templates/common.template.html +++ b/scripts/docs/templates/common.template.html @@ -74,6 +74,7 @@ docType: "<$ doc.docType $>" <@- endmacro -@> <@ block body @> +
View Source @@ -107,54 +108,108 @@ docType: "<$ doc.docType $>" <@ block header @>

+ <@ if doc.docType == "directive" @> - <$ doc.name | dashCase $> +<$ doc.name | dashCase $> + <@ else @> - <$ doc.name $> +<$ doc.name $> <@ endif @> + <@ if doc.parent @>
- Child of <$ doc.parent $> +Child of <$ doc.parent $> <@ endif @> + <@ if doc.delegate @>
- Delegate: <$ doc.delegate $> +Delegate: <$ doc.delegate $> <@ endif @> +

<@ if doc.codepen @> {% include codepen.html id="<$ doc.codepen $>" %} <@ endif @> + <@ endblock @> + +

Description

<@ block description @> <$ doc.description | marked $> <@ endblock @> + +<@- if doc.directiveInfo @> +

<$ doc.directiveInfo.type $>

+

<$ doc.directiveInfo.properties[0].name $>: <$ doc.directiveInfo.properties[0].values $>

+<@ endif -@> + + +

Usage

<@ if doc.usage @> <@ block usage @> <$ doc.usage | marked $> <@ endblock @> <@ endif @> -<@- if doc.directiveInfo @> -

<$ doc.directiveInfo.type $>

-<@- for prop in doc.directiveInfo.properties @> - <$ prop.name $>: <@ for v in prop.values @><$ v $><@ if not loop.last @>, <@ endif @><@ endfor @> + +<@ if doc.properties @> +

Attributes:

+ + + + + +<@ set hasTypes = false @> +<@ for prop in doc.properties @> +<@ if prop.type @> +<@ set hasTypes = true @> +<@ endif @> <@ endfor @> -<@ endif -@> +<@ if hasTypes @> + +<@ endif @> + + + + + +<@ for prop in doc.properties @> + + + +<@ if hasTypes @> + +<@ endif @> + + + +<@ endfor @> + +
AttributeTypeDescription
+<$ prop.name $> + +<$ prop.type.name $> + +<$ prop.description $> +
+<@ endif @> <@- if doc.members and doc.members.length @> -

Members

+ +

Methods

<@- for method in doc.members @>
+

- <$ functionSyntax(method) $> +<$ functionSyntax(method) $>

<$ method.description $> @@ -174,49 +229,15 @@ docType: "<$ doc.docType $>" <@ endif @> <@ endfor -@> + <@- endif -@> -<@ if doc.properties @> -

Attributes:

- - - - - <@ set hasTypes = false @> - <@ for prop in doc.properties @> - <@ if prop.type @> - <@ set hasTypes = true @> - <@ endif @> - <@ endfor @> - <@ if hasTypes @> - - <@ endif @> - - - - - <@ for prop in doc.properties @> - - - - <@ if hasTypes @> - - <@ endif @> - - - - <@ endfor @> - -
AttributeTypeDescription
- <$ prop.name $> - - <$ prop.type.name $> - - <$ prop.description $> -
-<@ endif @> + <@ endblock @> + + <@ endblock @> +