mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-31 18:49:43 +08:00
chore(docs): some fixes
This commit is contained in:
parent
5589f4d2ff
commit
4e5b3fa910
@ -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'))
|
||||||
|
|
||||||
|
15
scripts/docs/processors/mark-properties.js
Normal file
15
scripts/docs/processors/mark-properties.js
Normal 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;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
};
|
37
scripts/docs/templates/common.template.html
vendored
37
scripts/docs/templates/common.template.html
vendored
@ -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(', ') -@>
|
<@- set sep = joiner(', ') -@>
|
||||||
<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">β</span>
|
<span class="beta" title="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>
|
||||||
|
Loading…
Reference in New Issue
Block a user