mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
docs(): add controller tag, controller section
This commit is contained in:
@@ -45,8 +45,7 @@ module.exports = function(config) {
|
||||
require('./inline-tag-defs/link')
|
||||
]);
|
||||
|
||||
config.append('processing.tagDefinitions', require('./tag-defs/codepen'));
|
||||
config.append('processing.tagDefinitions', require('./tag-defs/parent'));
|
||||
config.append('processing.tagDefinitions', require('./tag-defs'));
|
||||
|
||||
//Don't conflict with the jekyll tags
|
||||
config.set('rendering.nunjucks.config.tags', {
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
module.exports = [{
|
||||
name: 'codepen'
|
||||
}];
|
||||
23
docs/tag-defs/index.js
Normal file
23
docs/tag-defs/index.js
Normal file
@@ -0,0 +1,23 @@
|
||||
module.exports = [
|
||||
{
|
||||
name: 'controller',
|
||||
transformFn: function(doc, tag) {
|
||||
return {
|
||||
path: '/docs/angularjs/api/ionic/controller/' + tag.description,
|
||||
name: tag.description
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'parent',
|
||||
transformFn: function(doc, tag) {
|
||||
return {
|
||||
path: '/docs/angularjs/api/ionic/directive/' + tag.description,
|
||||
name: tag.description
|
||||
};
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'codepen'
|
||||
}
|
||||
];
|
||||
@@ -1,11 +0,0 @@
|
||||
var _ = require('lodash');
|
||||
|
||||
module.exports = [{
|
||||
name: 'parent',
|
||||
transformFn: function(doc, tag) {
|
||||
return {
|
||||
path: 'docs/angularjs/ionic/api/directive/' + tag.description,
|
||||
name: tag.description
|
||||
};
|
||||
}
|
||||
}];
|
||||
7
docs/templates/api/api.template.html
vendored
7
docs/templates/api/api.template.html
vendored
@@ -7,7 +7,12 @@
|
||||
<h2><$ doc.name | dashCase $>
|
||||
<@ if doc.parent @>
|
||||
<small>
|
||||
(child of an <a href="<$ doc.parent.path $>"><$ doc.parent.name | dashCase $></a> element)
|
||||
(child of <a href="<$ doc.parent.path $>"><$ doc.parent.name | dashCase $></a>)
|
||||
</small>
|
||||
<@ endif @>
|
||||
<@ if doc.controller @>
|
||||
<small>
|
||||
(controller: <a href="<$ doc.controller.path $>"><$ doc.controller.name $></a>)
|
||||
</small>
|
||||
<@ endif @>
|
||||
</h2>
|
||||
|
||||
48
docs/templates/api/componentGroup.template.html
vendored
48
docs/templates/api/componentGroup.template.html
vendored
@@ -1,31 +1,27 @@
|
||||
---
|
||||
layout: docs_0.9.0
|
||||
active: javascript
|
||||
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 @>
|
||||
<h1>
|
||||
<@- if doc.title -@>
|
||||
<$ doc.title $>
|
||||
<@- elif doc.module -@>
|
||||
<$ doc.groupType | title $> components in <$ doc.module | code $>
|
||||
<@- else -@>
|
||||
Pages
|
||||
<@- endif -@>
|
||||
</h1>
|
||||
|
||||
<$ doc.description | marked $>
|
||||
<$ doc.description $>
|
||||
|
||||
<div class="component-breakdown">
|
||||
<div>
|
||||
<table class="definition-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>
|
||||
</div>
|
||||
</div>
|
||||
<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
docs/templates/api/controller.template.html
vendored
Normal file
9
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 @>
|
||||
2
docs/templates/api/filter.template.html
vendored
2
docs/templates/api/filter.template.html
vendored
@@ -20,7 +20,7 @@
|
||||
$filter('<$ doc.name $>')(<@ for param in doc.params @><$ sep() $><$ param.name $><@ endfor -@>)
|
||||
<@- endcode @>
|
||||
|
||||
<@ include "lib/params.template.html" @>
|
||||
<$ paramTable(doc.params) $>
|
||||
<@ include "lib/this.template.html" @>
|
||||
<@ include "lib/returns.template.html" @>
|
||||
<@ endblock @>
|
||||
|
||||
4
docs/templates/api/object.template.html
vendored
4
docs/templates/api/object.template.html
vendored
@@ -1,4 +1,4 @@
|
||||
<@ include "lib/macros.html" @>
|
||||
<@ include "lib/macros.html" -@>
|
||||
<@ extends "api/api.template.html" @>
|
||||
|
||||
<@ block additional @>
|
||||
@@ -16,7 +16,7 @@
|
||||
<$ functionSyntax(doc) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ include "lib/params.template.html" @>
|
||||
<$ paramTable(doc.params) $>
|
||||
<@ include "lib/this.template.html" @>
|
||||
<@ include "lib/returns.template.html" @>
|
||||
<@- endif @>
|
||||
|
||||
1
docs/templates/base.template.html
vendored
1
docs/templates/base.template.html
vendored
@@ -4,6 +4,7 @@ active: javascript
|
||||
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="pull-right">
|
||||
|
||||
12
docs/templates/lib/macros.html
vendored
12
docs/templates/lib/macros.html
vendored
@@ -1,5 +1,6 @@
|
||||
<@ macro typeList(types) -@>
|
||||
<@ for typeName in types @><a href="" class="<$ typeName | typeClass $>"><$ typeName | escape $></a><@ endfor @>
|
||||
<@ set separator = joiner("|") @>
|
||||
<@ for type in types @><$ separator() $><$ type | code $><@ endfor @>
|
||||
<@- endmacro -@>
|
||||
|
||||
<@ macro paramTable(params, isDirective) @>
|
||||
@@ -20,7 +21,7 @@
|
||||
<@ if param.type.optional @><div><em>(optional)</em></div><@ endif @>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.type.name $>
|
||||
<$ typeList(param.typeList) $>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.description | marked $>
|
||||
@@ -49,10 +50,5 @@
|
||||
<@ endmacro -@>
|
||||
|
||||
<@- macro typeInfo(fn) -@>
|
||||
<table class="variables-matrix return-arguments">
|
||||
<tr>
|
||||
<td><$ typeList(fn.typeList) $></td>
|
||||
<td><$ fn.description $></td>
|
||||
</tr>
|
||||
</table>
|
||||
<$ typeList(fn.typeList) $> <$ fn.description $>
|
||||
<@- endmacro -@>
|
||||
|
||||
5
docs/templates/lib/methods.template.html
vendored
5
docs/templates/lib/methods.template.html
vendored
@@ -15,10 +15,9 @@
|
||||
#### Method's `this`
|
||||
<$ method.this $>
|
||||
<@ endif @>
|
||||
|
||||
|
||||
<@ if method.returns @>
|
||||
**** Returns
|
||||
<$ typeInfo(method.returns) $>
|
||||
* Returns: <$ typeInfo(method.returns) $>
|
||||
<@ endif @>
|
||||
|
||||
<@ endfor -@>
|
||||
|
||||
33
docs/templates/lib/params.template.html
vendored
33
docs/templates/lib/params.template.html
vendored
@@ -1,33 +0,0 @@
|
||||
<@- if doc.params @>
|
||||
|
||||
## API
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><@ if doc.docType == "directive" @>Attributes<@ else @>Paramaters<@ endif @></th>
|
||||
<th>Type</th>
|
||||
<th>Details</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<@ for param in doc.params @>
|
||||
<tr>
|
||||
<td>
|
||||
<$ param.name $>
|
||||
<@ if param.alias @>| <$ param.alias $><@ endif @>
|
||||
<@ if param.type.optional @><div><em>(optional)</em></div><@ endif @>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.type.name $>
|
||||
</td>
|
||||
<td>
|
||||
<$ param.description | marked $>
|
||||
<@ if param.default @><p><em>(default: <$ param.default $>)</em></p><@ endif @>
|
||||
</td>
|
||||
</tr>
|
||||
<@ endfor @>
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
<@- endif -@>
|
||||
3
docs/templates/lib/properties.template.html
vendored
3
docs/templates/lib/properties.template.html
vendored
@@ -4,7 +4,8 @@
|
||||
<@- for property in doc.properties @>
|
||||
<li id="<$ property.name $>">
|
||||
<h3><$ property.name | code $></h3>
|
||||
<$ typeInfo(property) $>
|
||||
<code><$ property.returns.description $></code>
|
||||
<$ property.description $>
|
||||
</li>
|
||||
<@ endfor -@>
|
||||
</ul>
|
||||
|
||||
64
docs/templates/pages-data.template.html
vendored
64
docs/templates/pages-data.template.html
vendored
@@ -12,6 +12,28 @@
|
||||
<body class="docs {% if page.body_css %}{{ page.body_css }}{% else %}docs-page{% endif %}">
|
||||
{% endif %}
|
||||
|
||||
<style>
|
||||
.left-menu .api-section {
|
||||
display: none;
|
||||
border-top: 1px solid #EEE;
|
||||
padding-left: 10px;
|
||||
}
|
||||
.left-menu .api-section.active {
|
||||
border-color: #72a4f8;
|
||||
}
|
||||
.left-menu.active-menu .api-section {
|
||||
display: block;
|
||||
}
|
||||
.left-menu li.menu-subsection {
|
||||
margin-bottom: 0;
|
||||
padding-left: 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.left-menu li.menu-subsection.active > a {
|
||||
border: none;
|
||||
}
|
||||
</style>
|
||||
|
||||
{% include nav_links.html %}
|
||||
|
||||
{% include header.html %}
|
||||
@@ -140,21 +162,28 @@
|
||||
Javascript
|
||||
</a>
|
||||
</li>
|
||||
<@ for navItem in doc.areas.api.navGroups[0].navItems @>
|
||||
<@ if navItem.type == "section" @>
|
||||
<li class="menu-subsection">
|
||||
<$ navItem.name $>
|
||||
</li>
|
||||
<@ else @>
|
||||
<li class="menu-item{% if page.doc == "<$ navItem.name $>" %} active{% endif %}">
|
||||
<a href="{{ site.docs_0_9_0 }}/angularjs/<$ navItem.href $>">
|
||||
<@ if navItem.type == "directive" @>
|
||||
<$ navItem.name | dashCase $>
|
||||
<@ else @>
|
||||
<$ navItem.name $>
|
||||
<@ endif @>
|
||||
<@ for section in doc.areas.api.navGroups[0].navItems @>
|
||||
<@ if section.type == "section" @>
|
||||
<li class="menu-subsection{% if page.doc == "<$ section.name $>" %} active{% endif %}">
|
||||
<a href="{{ site.docs_0_9_0}}/angularjs/<$ section.href $>">
|
||||
<$ section.name $>
|
||||
</a>
|
||||
</li>
|
||||
<div class="api-section{% if page.docType == "<$ section.name $>" %} active{% endif %}">
|
||||
<@ for component in doc.areas.api.navGroups[0].navItems @>
|
||||
<@ if component.type == section.name @>
|
||||
<li class="menu-item{% if page.doc == "<$ component.name $>" %} active{% endif %}">
|
||||
<a href="{{ site.docs_0_9_0 }}/angularjs/<$ component.href $>">
|
||||
<@ if component.type == "directive" @>
|
||||
<$ component.name | dashCase $>
|
||||
<@ else @>
|
||||
<$ component.name $>
|
||||
<@ endif @>
|
||||
</a>
|
||||
</li>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
</div>
|
||||
<@ endif @>
|
||||
<@ endfor @>
|
||||
</ul>
|
||||
@@ -287,14 +316,5 @@ ol-b">
|
||||
|
||||
{% include footer.html %}
|
||||
|
||||
{% include base_scripts.html %}
|
||||
|
||||
<style>
|
||||
.left-menu li.menu-subsection {
|
||||
padding-left: 0.5em;
|
||||
font-weight: bold;
|
||||
}
|
||||
.left-menu li.menu-item {
|
||||
}
|
||||
{% include base_scripts.html %}
|
||||
</body>
|
||||
|
||||
Reference in New Issue
Block a user