generate api index page

This commit is contained in:
Tim Lancina
2015-09-01 15:07:00 -05:00
parent 481fd7f651
commit d0c9f1404e
28 changed files with 1183 additions and 1 deletions

View File

@@ -0,0 +1,79 @@
---
<@ include "lib/yaml.template.html" @>
title: "<@ if doc.docType == "directive" @><$ doc.name | dashCase $><@ else @><$ doc.name $><@ endif @>"
header_sub_title: "<$ doc.docType | capital $> in module <$ doc.module $>"
doc: "<$ doc.name $>"
docType: "<$ doc.docType $>"
---
<div class="improve-docs">
<a href='http://github.com/driftyco/ionic/tree/master/<$ doc.relativePath $>#L<$ doc.startingLine $>'>
View Source
</a>
&nbsp;
<a href='http://github.com/driftyco/ionic/edit/master/<$ doc.relativePath $>#L<$ doc.startingLine $>'>
Improve this doc
</a>
</div>
<@ block content @>
<@ block header @>
<h1 class="api-title">
<@ if doc.docType == "directive" @>
<$ doc.name | dashCase $>
<@ else @>
<$ doc.name $>
<@ endif @>
<@ if doc.parent @>
<br />
<small>
Child of <$ doc.parent $>
</small>
<@ endif @>
<@ if doc.delegate @>
<br/>
<small>
Delegate: <$ doc.delegate $>
</small>
<@ endif @>
</h1>
<@ if doc.codepen @>
{% include codepen.html id="<$ doc.codepen $>" %}
<@ endif @>
<@ endblock @>
<@ block description @>
<$ doc.description $>
<@ endblock @>
<@ if doc.deprecated @>
<fieldset class="deprecated">
<legend>Deprecated API</legend>
<$ doc.deprecated| marked $>
</fieldset>
<@ endif @>
<@ block dependencies @>
<@- if doc.requires @>
<h2 id="dependencies">Dependencies</h2>
<ul>
<@ for require in doc.requires @><li><$ require | link $></li><@ endfor @>
</ul>
<@ endif -@>
<@ endblock @>
<@ block additional @>
<@ endblock @>
<@ block examples @>
<@- if doc.examples @>
<h2 id="example">Example</h2>
<@- for example in doc.examples -@>
<$ example | marked $>
<@- endfor -@>
<@ endif -@>
<@ endblock @>
<@ endblock @>

View File

@@ -0,0 +1,26 @@
---
<@ include "lib/yaml.template.html" @>
title: "<@ if doc.title @><$ doc.title $><@ elif doc.module @><$ doc.groupType | title $>s in module ionic<@ else @>Pages<@ endif @>"
header_sub_title: "<$ doc.components.length $> <$ doc.groupType $>s"
doc: "<$ doc.groupType $>"
docType: "<$ doc.groupType $>"
---
<@ block content @>
<$ doc.description $>
<table class="table">
<tr>
<th>Name</th>
<th>Description</th>
</tr>
<@ for page in doc.components @>
<tr>
<td><$ page.id | link(page.name, page) $></td>
<td><$ page.description | firstParagraph | marked $></td>
</tr>
<@ endfor @>
</table>
<@ endblock @>

View File

@@ -0,0 +1,9 @@
<@ extends "api/object.template.html" @>
<@ block related_components @>
<@ if doc.providerDoc -@>
<li>
<a href="<$ doc.providerDoc.path $>">- <$ doc.providerDoc.name $></a>
</li>
<@- endif @>
<@ endblock @>

View File

@@ -0,0 +1,56 @@
<@ include "lib/macros.html" -@>
<@ extends "api/api.template.html" @>
<@ block additional @>
<@ block usage @>
<h2 id="usage">Usage</h2>
<@ if doc.usage @>
<$ doc.usage $>
<@ else @>
<@ if doc.restrict.element @>
```html
<<$ doc.name | dashCase $>
<@- for param in doc.params @>
<$ directiveParam(param.alias or param.name, param.type, '="', '"') $>
<@- endfor @>>
...
</<$ doc.name | dashCase $>>
```
<@ endif -@>
<@- if doc.restrict.attribute -@>
```html
<<$ doc.element $>
<@- for param in doc.params @>
<$ directiveParam(param.name, param.type, '="', '"') $>
<@- endfor @>>
...
</<$ doc.element $>>
```
<@ endif -@>
<@- if doc.restrict.cssClass -@>
```html
<@ set sep = joiner(' ') @>
<<$ doc.element $> class="
<@- for param in doc.params -@>
<$ sep() $><$ directiveParam(param.name, param.type, ': ', ';') $>
<@- endfor @>"> ... </<$ doc.element $>>
```
<@ endif -@>
<@- endif @>
<@ endblock -@>
<@ if doc.params @>
<h2 id="api" style="clear:both;">API</h2>
<$ paramTable(doc.params, true) $>
<@ endif @>
<@ include "lib/events.template.html" @>
<@ endblock @>

View File

@@ -0,0 +1,26 @@
<@ include "lib/macros.html" -@>
<@ extends "api/api.template.html" @>
<@ block additional @>
<h2>Usage</h2>
<h3>In HTML Template Binding</h3>
<@ if doc.usage @>
<$ doc.usage | code $>
<@ else @>
<@ code -@>
{{ <$ doc.name $>_expression | <$ doc.name $>
<@- for param in doc.params @> : <$ param.name $><@ endfor -@>
}}
<@- endcode @>
<@ endif @>
<h3>In JavaScript</h3>
<@ code -@>
<@- set sep = joiner(', ') -@>
$filter('<$ doc.name $>')(<@ for param in doc.params @><$ sep() $><$ param.name $><@ endfor -@>)
<@- endcode @>
<$ paramTable(doc.params) $>
<@ include "lib/this.template.html" @>
<@ include "lib/returns.template.html" @>
<@ endblock @>

View File

@@ -0,0 +1 @@
<@ extends "api/object.template.html" @>

View File

@@ -0,0 +1,28 @@
<@ include "lib/macros.html" -@>
<@ extends "api/api.template.html" @>
<@ block additional @>
<@ if doc.usage @>
## Usage
<$ doc.usage $>
<@ endif @>
<@ if doc.params or doc.returns or doc.this or doc.kind == 'function' -@>
<h2 id="usage">Usage</h2>
<@ if doc.usage @>
<$ doc.usage $>
<@ else @>
<$ functionSyntax(doc) $>
<@ endif @>
<$ paramTable(doc.params) $>
<@ include "lib/this.template.html" @>
<@ include "lib/returns.template.html" @>
<@- endif @>
<@ include "lib/methods.template.html" @>
<@ include "lib/events.template.html" @>
<@ include "lib/properties.template.html" @>
<@ endblock @>

View File

@@ -0,0 +1 @@
<@ extends "api/object.template.html" @>

View File

@@ -0,0 +1,9 @@
<@ extends "api/object.template.html" @>
<@ block related_components @>
<@ if doc.serviceDoc -@>
<li>
<a href="<$ doc.serviceDoc.path $>">- <$ doc.serviceDoc.name $></a>
</li>
<@- endif @>
<@ endblock @>

View File

@@ -0,0 +1,9 @@
<@ extends "api/object.template.html" @>
<@ block related_components @>
<@ if doc.providerDoc -@>
<li>
<a href="<$ doc.providerDoc.path $>">- <$ doc.providerDoc.name $></a>
</li>
<@- endif @>
<@ endblock @>

View File

@@ -0,0 +1 @@
<@ extends "api/object.template.html" @>

View File

@@ -0,0 +1,9 @@
<@ extends "api/object.template.html" @>
<@ block related_components @>
<@ if doc.providerDoc -@>
<li>
<a href="<$ doc.providerDoc.path $>">- <$ doc.providerDoc.name $></a>
</li>
<@- endif @>
<@ endblock @>