mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-01-19 00:12:53 +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/hide-private-api'))
|
||||
.processor(require('./processors/parse-optional'))
|
||||
.processor(require('./processors/mark-properties'))
|
||||
.processor(require('./processors/npm-id'))
|
||||
.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 $>"
|
||||
docType: "<$ doc.docType $>"
|
||||
---
|
||||
|
||||
<@- macro interfaceTable(interface) -@>
|
||||
<@ for export in doc.moduleDoc.exports -@>
|
||||
<@ if export.name == interface @>
|
||||
@ -78,12 +79,11 @@ docType: "<$ doc.docType $>"
|
||||
<@- macro functionSyntax(fn) @>
|
||||
<@- set sep = joiner(', ') -@>
|
||||
<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 $>
|
||||
<@- if param.type.optional @>]<@ endif -@>
|
||||
<@ endfor @><@- if not fn.isProperty @>)<@ endif -@></code>
|
||||
<@ if fn.alias @><small>(alias: <$ fn.alias $>)</small><@ endif @>
|
||||
<@ endmacro -@>
|
||||
<@- if param.type.optional -@>]<@- endif -@>
|
||||
<@- endfor -@><@- if not fn.isProperty @>)<@- endif -@></code>
|
||||
<@- endmacro -@>
|
||||
|
||||
<@- macro typeList(types) -@>
|
||||
<@ set separator = joiner("|") @>
|
||||
@ -109,7 +109,7 @@ docType: "<$ doc.docType $>"
|
||||
<@- endif @>
|
||||
<@- endmacro -@>
|
||||
|
||||
<@- macro documentMethod(method) -@>
|
||||
<@ macro documentMethod(method) -@>
|
||||
<h3><a class="anchor" name="<$ method.name $>" href="#<$ method.name $>"></a><$ functionSyntax(method) $></h3>
|
||||
<$ documentPlatforms(method) $>
|
||||
<$ method.description $>
|
||||
@ -141,28 +141,9 @@ docType: "<$ doc.docType $>"
|
||||
<$ documentMethod(method) $>
|
||||
<@- endfor @>
|
||||
<@- endif -@>
|
||||
<@- endmacro -@>
|
||||
<@ endmacro @>
|
||||
|
||||
<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 class="api-title"><$ doc.name $>
|
||||
<@- if doc.beta == true -@>
|
||||
<span class="beta" title="beta">β</span>
|
||||
<@- endif -@>
|
||||
@ -182,6 +163,8 @@ docType: "<$ doc.docType $>"
|
||||
href="<$ prop.repo $>/issues">plugin repo</a>.
|
||||
</p>
|
||||
<@ endif @>
|
||||
|
||||
<# --- Install commands --- #>
|
||||
<pre><code class="nohighlight">$ <@ if prop.install @><$ prop.install $><@ else @>ionic plugin add <$ prop.plugin $><@ endif @>
|
||||
$ npm install --save @ionic-native/<$ doc.npmId $>
|
||||
</code></pre>
|
||||
|
Loading…
Reference in New Issue
Block a user