chore(docs): some fixes

This commit is contained in:
Ibby 2017-03-23 22:39:12 -04:00
parent 5589f4d2ff
commit 4e5b3fa910
3 changed files with 26 additions and 27 deletions

View File

@ -14,6 +14,7 @@ module.exports = currentVersion => {
.processor(require('./processors/remove-private-members')) .processor(require('./processors/remove-private-members'))
.processor(require('./processors/hide-private-api')) .processor(require('./processors/hide-private-api'))
.processor(require('./processors/parse-optional')) .processor(require('./processors/parse-optional'))
.processor(require('./processors/mark-properties'))
.processor(require('./processors/npm-id')) .processor(require('./processors/npm-id'))
.processor(require('./processors/jekyll')) .processor(require('./processors/jekyll'))

View File

@ -0,0 +1,15 @@
"use strict";
module.exports = function markProperties() {
return {
name: 'mark-properties',
$runBefore: ['rendering-docs'],
$process: docs => docs.map(doc => {
for (let i in doc.members) {
if (doc.members.hasOwnProperty(i) && typeof doc.members[i].parameters === 'undefined') {
doc.members[i].isProperty = true;
}
}
return doc;
})
}
};

View File

@ -10,6 +10,7 @@ header_sub_title: "<$ doc.docType | capital $> in module <$ doc.module $>"
doc: "<$ doc.name $>" doc: "<$ doc.name $>"
docType: "<$ doc.docType $>" docType: "<$ doc.docType $>"
--- ---
<@- macro interfaceTable(interface) -@> <@- macro interfaceTable(interface) -@>
<@ for export in doc.moduleDoc.exports -@> <@ for export in doc.moduleDoc.exports -@>
<@ if export.name == interface @> <@ if export.name == interface @>
@ -78,12 +79,11 @@ docType: "<$ doc.docType $>"
<@- macro functionSyntax(fn) @> <@- macro functionSyntax(fn) @>
<@- set sep = joiner(',&nbsp;') -@> <@- set sep = joiner(',&nbsp;') -@>
<code><$ fn.name $><@- if not fn.isProperty @>(<@ endif -@><@- for param in fn.params @><$ sep() $> <code><$ fn.name $><@- if not fn.isProperty @>(<@ endif -@><@- for param in fn.params @><$ sep() $>
<@- if param.type.optional @>[<@ endif -@> <@- if param.type.optional @>[<@- endif -@>
<$ param.name $> <$ param.name $>
<@- if param.type.optional @>]<@ endif -@> <@- if param.type.optional -@>]<@- endif -@>
<@ endfor @><@- if not fn.isProperty @>)<@ endif -@></code> <@- endfor -@><@- if not fn.isProperty @>)<@- endif -@></code>
<@ if fn.alias @><small>(alias: <$ fn.alias $>)</small><@ endif @> <@- endmacro -@>
<@ endmacro -@>
<@- macro typeList(types) -@> <@- macro typeList(types) -@>
<@ set separator = joiner("|") @> <@ set separator = joiner("|") @>
@ -109,7 +109,7 @@ docType: "<$ doc.docType $>"
<@- endif @> <@- endif @>
<@- endmacro -@> <@- endmacro -@>
<@- macro documentMethod(method) -@> <@ macro documentMethod(method) -@>
<h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3> <h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3>
<$ documentPlatforms(method) $> <$ documentPlatforms(method) $>
<$ method.description $> <$ method.description $>
@ -141,28 +141,9 @@ docType: "<$ doc.docType $>"
<$ documentMethod(method) $> <$ documentMethod(method) $>
<@- endfor @> <@- endfor @>
<@- endif -@> <@- endif -@>
<@- endmacro -@> <@ endmacro @>
<h1 class="api-title"> <h1 class="api-title"><$ doc.name $>
<@ 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 @>
<@- if doc.beta == true -@> <@- if doc.beta == true -@>
<span class="beta" title="beta">&beta;</span> <span class="beta" title="beta">&beta;</span>
<@- endif -@> <@- endif -@>
@ -182,6 +163,8 @@ docType: "<$ doc.docType $>"
href="<$ prop.repo $>/issues">plugin repo</a>. href="<$ prop.repo $>/issues">plugin repo</a>.
</p> </p>
<@ endif @> <@ endif @>
<# --- Install commands --- #>
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif @> <pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif @>
$ npm install --save @ionic-native/<$ doc.npmId $> $ npm install --save @ionic-native/<$ doc.npmId $>
</code></pre> </code></pre>