mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
generate api index page
This commit is contained in:
79
scripts/docs/templates/api/api.template.html
vendored
Normal file
79
scripts/docs/templates/api/api.template.html
vendored
Normal 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>
|
||||
|
||||
<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 @>
|
||||
26
scripts/docs/templates/api/componentGroup.template.html
vendored
Normal file
26
scripts/docs/templates/api/componentGroup.template.html
vendored
Normal 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 @>
|
||||
9
scripts/docs/templates/api/controller.template.html
vendored
Normal file
9
scripts/docs/templates/api/controller.template.html
vendored
Normal 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 @>
|
||||
56
scripts/docs/templates/api/directive.template.html
vendored
Normal file
56
scripts/docs/templates/api/directive.template.html
vendored
Normal 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 @>
|
||||
26
scripts/docs/templates/api/filter.template.html
vendored
Normal file
26
scripts/docs/templates/api/filter.template.html
vendored
Normal 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 @>
|
||||
1
scripts/docs/templates/api/function.template.html
vendored
Normal file
1
scripts/docs/templates/api/function.template.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<@ extends "api/object.template.html" @>
|
||||
28
scripts/docs/templates/api/object.template.html
vendored
Normal file
28
scripts/docs/templates/api/object.template.html
vendored
Normal 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 @>
|
||||
1
scripts/docs/templates/api/page.template.html
vendored
Normal file
1
scripts/docs/templates/api/page.template.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<@ extends "api/object.template.html" @>
|
||||
9
scripts/docs/templates/api/provider.template.html
vendored
Normal file
9
scripts/docs/templates/api/provider.template.html
vendored
Normal 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 @>
|
||||
9
scripts/docs/templates/api/service.template.html
vendored
Normal file
9
scripts/docs/templates/api/service.template.html
vendored
Normal 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 @>
|
||||
1
scripts/docs/templates/api/type.template.html
vendored
Normal file
1
scripts/docs/templates/api/type.template.html
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<@ extends "api/object.template.html" @>
|
||||
9
scripts/docs/templates/api/utility.template.html
vendored
Normal file
9
scripts/docs/templates/api/utility.template.html
vendored
Normal 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 @>
|
||||
Reference in New Issue
Block a user