From 64ef69fb3464ab815f507c94d944cd42fb378b75 Mon Sep 17 00:00:00 2001 From: Stefanie Fluin Date: Mon, 24 Apr 2017 10:49:37 -0700 Subject: [PATCH] feat(aio): api page column layout --- aio/src/styles/1-layouts/_api-page.scss | 35 ---------- .../templates/includes/_annotations.html | 8 +-- .../templates/includes/_class-overview.html | 70 +++++++++---------- .../templates/includes/_constructor.html | 28 ++++---- .../templates/includes/_description.html | 10 +-- .../templates/includes/_export-as.html | 16 ++--- .../templates/includes/_how-to-use.html | 12 ++-- .../templates/includes/_inputs.html | 20 +++--- .../includes/_interface-overview.html | 4 +- .../templates/includes/_members.html | 30 ++++---- .../templates/includes/_metadata.html | 6 +- .../templates/includes/_outputs.html | 14 ++-- .../templates/includes/_selectors.html | 20 +++--- .../templates/includes/_statics.html | 8 +-- 14 files changed, 101 insertions(+), 180 deletions(-) diff --git a/aio/src/styles/1-layouts/_api-page.scss b/aio/src/styles/1-layouts/_api-page.scss index ef3ee3d8f8..e0bf9cff60 100644 --- a/aio/src/styles/1-layouts/_api-page.scss +++ b/aio/src/styles/1-layouts/_api-page.scss @@ -1,42 +1,7 @@ .api-section { - display: flex; - flex-direction: row; - vertical-align: top; position: relative; - margin-bottom: 32px; - padding: 8px 0 16px; pre { white-space: pre-line; } - - &:after { - content:""; - display: block; - position: absolute; - bottom: 0; - left: 0; - right: 0; - border-bottom: 1px solid $lightgray; - width: 100%; - } -} - -.api-section-header { - width: 30%; - display: inline-block; - margin-right: 32px; - - h2, p { - margin: 0; - } -} - -.api-section-content { - width: 60%; - display: inline-block; - - p { - margin: 0 0 8px 0; - } } \ No newline at end of file diff --git a/aio/tools/transforms/templates/includes/_annotations.html b/aio/tools/transforms/templates/includes/_annotations.html index a8e4c7c57d..8f9b4c6317 100644 --- a/aio/tools/transforms/templates/includes/_annotations.html +++ b/aio/tools/transforms/templates/includes/_annotations.html @@ -1,15 +1,11 @@ {%- if doc.decorators.length %} -
-
+

Annotations

-
-
{%- for decorator in doc.decorators %}
         @{$ decorator.name $}{$ params.paramList(decorator.arguments) | indent(10, false) $}
       
{%- if not decorator.notYetDocumented %}{$ decorator.description | marked $}{% endif %} {% endfor %} -
-
+ {% endif %} diff --git a/aio/tools/transforms/templates/includes/_class-overview.html b/aio/tools/transforms/templates/includes/_class-overview.html index f2a43a948f..63cefabda1 100644 --- a/aio/tools/transforms/templates/includes/_class-overview.html +++ b/aio/tools/transforms/templates/includes/_class-overview.html @@ -1,44 +1,40 @@
-
-

Class Overview

-
-
-
+

Class Overview

+
- class {$ doc.name $} { + 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 $}
+    {% 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 %} - - {% 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 %} - - } + {% 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 %} + + }
\ No newline at end of file diff --git a/aio/tools/transforms/templates/includes/_constructor.html b/aio/tools/transforms/templates/includes/_constructor.html index 1f9b08bc0f..012dcdcb6f 100644 --- a/aio/tools/transforms/templates/includes/_constructor.html +++ b/aio/tools/transforms/templates/includes/_constructor.html @@ -1,18 +1,14 @@ {%- 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 %} -
-
+
+

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 %} diff --git a/aio/tools/transforms/templates/includes/_description.html b/aio/tools/transforms/templates/includes/_description.html index c67bdad1e0..d42e1762c3 100644 --- a/aio/tools/transforms/templates/includes/_description.html +++ b/aio/tools/transforms/templates/includes/_description.html @@ -1,10 +1,6 @@ -
-
-

Descriptionlink

-
-
+
+

Descriptionlink

{%- if doc.description.length > 2 %} {$ doc.description | trimBlankLines | marked $} {% endif %} -
-
+ diff --git a/aio/tools/transforms/templates/includes/_export-as.html b/aio/tools/transforms/templates/includes/_export-as.html index 702b1bae1b..23c0cf79fb 100644 --- a/aio/tools/transforms/templates/includes/_export-as.html +++ b/aio/tools/transforms/templates/includes/_export-as.html @@ -1,12 +1,8 @@ {%- if doc.directiveOptions.exportAs %} -
-
-

Exported as

-
-
-

- {$ doc.directiveOptions.exportAs $} -

-
-
+
+

Exported as

+

+ {$ doc.directiveOptions.exportAs $} +

+
{% endif %} diff --git a/aio/tools/transforms/templates/includes/_how-to-use.html b/aio/tools/transforms/templates/includes/_how-to-use.html index 45bea41235..a861e27a49 100644 --- a/aio/tools/transforms/templates/includes/_how-to-use.html +++ b/aio/tools/transforms/templates/includes/_how-to-use.html @@ -1,11 +1,7 @@ {%- if doc.howToUse %} -
-
-

How To Use

-
-
- {$ doc.howToUse | marked $} -
-
+
+

How To Use

+ {$ doc.howToUse | marked $} +
{% endif %} diff --git a/aio/tools/transforms/templates/includes/_inputs.html b/aio/tools/transforms/templates/includes/_inputs.html index 23bcfda2e3..85f9aef3ea 100644 --- a/aio/tools/transforms/templates/includes/_inputs.html +++ b/aio/tools/transforms/templates/includes/_inputs.html @@ -1,15 +1,11 @@ {% if doc.inputs %} -
-
-

Inputs

+
+

Inputs

+ {% for binding, property in doc.inputs %} +
+ {$ property.bindingName $} bound to {$ property.memberDoc.classDoc.name $}.{$ property.propertyName $} + {$ property.memberDoc.description | trimBlankLines | marked $}
-
- {% for binding, property in doc.inputs %} -
- {$ property.bindingName $} bound to {$ property.memberDoc.classDoc.name $}.{$ property.propertyName $} - {$ property.memberDoc.description | trimBlankLines | marked $} -
- {% endfor %} -
-
+ {% endfor %} + {% endif %} diff --git a/aio/tools/transforms/templates/includes/_interface-overview.html b/aio/tools/transforms/templates/includes/_interface-overview.html index 2c91bbda36..27866ffad3 100644 --- a/aio/tools/transforms/templates/includes/_interface-overview.html +++ b/aio/tools/transforms/templates/includes/_interface-overview.html @@ -1,4 +1,4 @@ -
+

Interface Overview

@@ -16,4 +16,4 @@ }
-
\ No newline at end of file + \ No newline at end of file diff --git a/aio/tools/transforms/templates/includes/_members.html b/aio/tools/transforms/templates/includes/_members.html index 3dda7e36e9..22ca9c031a 100644 --- a/aio/tools/transforms/templates/includes/_members.html +++ b/aio/tools/transforms/templates/includes/_members.html @@ -1,21 +1,17 @@ {% if doc.members.length %} -
-
-

Class Details

+
+

Class Details

+ {% for member in doc.members %}{% if not member.internal %} +
+ +
+    {$ member.name $}{$ params.paramList(member.parameters) | trim $}{$ params.returnType(member.returnType) $}
+    
+ {%- if not member.notYetDocumented %} + {$ member.description | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines | marked $} + {% endif -%}
-
- {% for member in doc.members %}{% if not member.internal %} -
- -
-      {$ member.name $}{$ params.paramList(member.parameters) | trim $}{$ params.returnType(member.returnType) $}
-      
- {%- if not member.notYetDocumented %} - {$ member.description | replace('### Example', '') | replace('## Example', '') | replace('# Example', '') | trimBlankLines | marked $} - {% endif -%} -
- {% if not loop.last %}
{% endif %} + {% if not loop.last %}
{% endif %} {% endif %}{% endfor %} -
-
+ {% endif %} diff --git a/aio/tools/transforms/templates/includes/_metadata.html b/aio/tools/transforms/templates/includes/_metadata.html index 5bca45a8e7..d3d1a09e24 100644 --- a/aio/tools/transforms/templates/includes/_metadata.html +++ b/aio/tools/transforms/templates/includes/_metadata.html @@ -1,7 +1,6 @@ {% if doc.members.length %} - + {% endif %} diff --git a/aio/tools/transforms/templates/includes/_outputs.html b/aio/tools/transforms/templates/includes/_outputs.html index a1b313a9d4..74aa43a23f 100644 --- a/aio/tools/transforms/templates/includes/_outputs.html +++ b/aio/tools/transforms/templates/includes/_outputs.html @@ -1,13 +1,11 @@ {% if doc.outputs %} -
+

Outputs

-
{% for binding, property in doc.outputs %} -
- {$ property.bindingName $} bound to {$ property.memberDoc.classDoc.name $}.{$ property.propertyName $} - {$ property.memberDoc.description | trimBlankLines | marked $} -
- {% endfor %} +
+ {$ property.bindingName $} bound to {$ property.memberDoc.classDoc.name $}.{$ property.propertyName $} + {$ property.memberDoc.description | trimBlankLines | marked $}
-
+ {% endfor %} + {% endif %} diff --git a/aio/tools/transforms/templates/includes/_selectors.html b/aio/tools/transforms/templates/includes/_selectors.html index 4b8ce6ee90..9c82dbdd2a 100644 --- a/aio/tools/transforms/templates/includes/_selectors.html +++ b/aio/tools/transforms/templates/includes/_selectors.html @@ -1,14 +1,10 @@ {%- if doc.directiveOptions.selector.split(',').length %} -
-
-

Selectors

-
-
- {% for selector in doc.directiveOptions.selector.split(',') %} -

- {$ selector $} -

- {% endfor %} -
-
+
+

Selectors

+ {% for selector in doc.directiveOptions.selector.split(',') %} +

+ {$ selector $} +

+ {% endfor %} +
{% endif %} diff --git a/aio/tools/transforms/templates/includes/_statics.html b/aio/tools/transforms/templates/includes/_statics.html index e3f0cfd626..00929c4c30 100644 --- a/aio/tools/transforms/templates/includes/_statics.html +++ b/aio/tools/transforms/templates/includes/_statics.html @@ -1,9 +1,6 @@ {% if doc.statics.length %} -
-
+

Static Members

-
-
{% for member in doc.statics %}{% if not member.internal %}
@@ -20,6 +17,5 @@ {% endif %} {% endif %}{% endfor %} -
-
+ {% endif %}