mirror of
https://github.com/danielsogl/awesome-cordova-plugins.git
synced 2025-02-22 01:19:36 +08:00
docs(): docs now display interfaces and related classes
document interfaces + other classes
This commit is contained in:
commit
6ff8f03ef0
@ -31,12 +31,37 @@ module.exports = function(currentVersion) {
|
|||||||
// $runBefore: ['rendering-docs'],
|
// $runBefore: ['rendering-docs'],
|
||||||
// $process: function(docs){
|
// $process: function(docs){
|
||||||
// docs.forEach(function(doc){
|
// docs.forEach(function(doc){
|
||||||
// if (doc.members && doc.name == "IonicApp"){
|
// if (doc.name == "Camera"){
|
||||||
// doc.members.forEach(function(method){
|
//
|
||||||
// if (method.name === "load") {
|
// // console.log(doc.tags);
|
||||||
// console.log(method);
|
// // doc.tags.forEach(function(tag){
|
||||||
// }
|
// // if(tag.tagName == 'classes'){
|
||||||
// })
|
// //
|
||||||
|
// // }
|
||||||
|
// // });
|
||||||
|
//
|
||||||
|
// // doc.moduleDoc.exports.forEach(function(d,i){
|
||||||
|
// // if(d.name === 'CameraOptions') {
|
||||||
|
// // console.log('Name: ' + d.name);
|
||||||
|
// // console.log('Type: ' + d.docType);
|
||||||
|
// // console.log('First member: ', d.members[0]);
|
||||||
|
// // }
|
||||||
|
// // });
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// // var exports = doc.exportSymbol.parent.exports;
|
||||||
|
// // for(var p in exports) {
|
||||||
|
// // if(p == 'CameraOptions')
|
||||||
|
// // {
|
||||||
|
// // var x = exports[p];
|
||||||
|
// // console.log(x.members.quality);
|
||||||
|
// // }
|
||||||
|
// // }
|
||||||
|
// // doc.members.forEach(function(method){
|
||||||
|
// // if (method.name === "getPicture") {
|
||||||
|
// // console.log(method);
|
||||||
|
// // }
|
||||||
|
// // })
|
||||||
// }
|
// }
|
||||||
// })
|
// })
|
||||||
// }
|
// }
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
module.exports = [
|
module.exports = [
|
||||||
{'name': 'advanced'},
|
{'name': 'advanced'},
|
||||||
{'name': 'demo'},
|
{'name': 'demo'},
|
||||||
{'name': 'usage'}
|
{'name': 'usage'},
|
||||||
|
{'name': 'classes'}, // related classes
|
||||||
|
{'name': 'interfaces'} // related interfaces
|
||||||
];
|
];
|
||||||
|
232
scripts/docs/templates/common.template.html
vendored
232
scripts/docs/templates/common.template.html
vendored
@ -11,6 +11,39 @@ doc: "<$ doc.name $>"
|
|||||||
docType: "<$ doc.docType $>"
|
docType: "<$ doc.docType $>"
|
||||||
---
|
---
|
||||||
|
|
||||||
|
<@ macro interfaceTable(interface) @>
|
||||||
|
<@ for export in doc.moduleDoc.exports -@>
|
||||||
|
<@ if export.name == interface @>
|
||||||
|
<table class="table param-table" style="margin:0;">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Param</th>
|
||||||
|
<th>Type</th>
|
||||||
|
<th>Details</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<@ for param in export.members @>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<$ param.name $>
|
||||||
|
<@ if param.optional @><div><em>(optional)</em></div><@ endif @>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<$ param.returnType | escape $>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<$ param.description | marked $>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<@ endfor @>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<@ endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<@ endmacro @>
|
||||||
|
|
||||||
<@ macro paramList(paramData) -@>
|
<@ macro paramList(paramData) -@>
|
||||||
<@- if paramData -@><span class="params">(
|
<@- if paramData -@><span class="params">(
|
||||||
<@- for param in paramData -@>
|
<@- for param in paramData -@>
|
||||||
@ -73,15 +106,81 @@ docType: "<$ doc.docType $>"
|
|||||||
<$ typeList(fn.typeList) $> <$ fn.description $>
|
<$ typeList(fn.typeList) $> <$ fn.description $>
|
||||||
<@- endmacro -@>
|
<@- endmacro -@>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<@ macro documentClass(doc) @>
|
||||||
|
<@- if doc.statics.length -@>
|
||||||
|
<h2>Static Members</h2>
|
||||||
|
<@ for method in doc.statics -@>
|
||||||
|
<@ if not method.internal @>
|
||||||
|
<div id="<$ method.name $>"></div>
|
||||||
|
<h3><$ functionSyntax(method) $></h3>
|
||||||
|
<@- if method.decorators @>
|
||||||
|
<@ for prop in method.decorators[0].argumentInfo @>
|
||||||
|
<@ if prop.platforms @>
|
||||||
|
<p>
|
||||||
|
<b>Platforms:</b>
|
||||||
|
<@- for platform in prop.platforms @>
|
||||||
|
<code><$ platform $></code>
|
||||||
|
<@ endfor -@>
|
||||||
|
</p>
|
||||||
|
<@ endif @>
|
||||||
|
<@ endfor @>
|
||||||
|
<@- endif @>
|
||||||
|
|
||||||
|
<$ method.description $>
|
||||||
|
|
||||||
|
<@ if method.params @>
|
||||||
|
<$ paramTable(method.params) $>
|
||||||
|
<@ endif @>
|
||||||
|
|
||||||
|
<@ if method.this -@>
|
||||||
|
<h4> Method's `this`
|
||||||
|
<$ method.this $>
|
||||||
|
</h4>
|
||||||
|
<@- endif @>
|
||||||
|
|
||||||
|
<@ if method.returns @>
|
||||||
|
<div class="return-value" markdown="1">
|
||||||
|
<i class="icon ion-arrow-return-left"></i>
|
||||||
|
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||||
|
</div>
|
||||||
|
<@ endif @>
|
||||||
|
<@ endif @>
|
||||||
|
<@ endfor -@>
|
||||||
|
<@ endif @>
|
||||||
|
|
||||||
|
<!-- methods on the class -->
|
||||||
|
<@- if doc.members and doc.members.length @>
|
||||||
|
|
||||||
|
<h2>Instance Members</h2>
|
||||||
|
<@ for method in doc.members -@>
|
||||||
|
<div id="<$ method.name $>"></div>
|
||||||
|
<h3>
|
||||||
|
<$ functionSyntax(method) $>
|
||||||
|
</h3>
|
||||||
|
<$ method.description $>
|
||||||
|
<@ if method.params -@>
|
||||||
|
<$ paramTable(method.params) $>
|
||||||
|
<@- endif @>
|
||||||
|
<@ if method.this -@>
|
||||||
|
<h4> Method's `this`
|
||||||
|
<$ method.this $>
|
||||||
|
</h4>
|
||||||
|
<@- endif @>
|
||||||
|
<@ if method.returns -@>
|
||||||
|
<div class="return-value" markdown="1">
|
||||||
|
<i class="icon ion-arrow-return-left"></i>
|
||||||
|
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
||||||
|
</div>
|
||||||
|
<@- endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<@- endif -@>
|
||||||
|
<@ endmacro @>
|
||||||
<@ block body @>
|
<@ block body @>
|
||||||
|
|
||||||
|
|
||||||
<@ block content @>
|
<@ block content @>
|
||||||
|
|
||||||
<@ block header @>
|
<@ block header @>
|
||||||
|
|
||||||
<h1 class="api-title">
|
<h1 class="api-title">
|
||||||
|
|
||||||
<@ if doc.docType == "directive" @>
|
<@ if doc.docType == "directive" @>
|
||||||
<$ doc.name | dashCase $>
|
<$ doc.name | dashCase $>
|
||||||
<@ else @>
|
<@ else @>
|
||||||
@ -108,10 +207,6 @@ docType: "<$ doc.docType $>"
|
|||||||
Improve this doc
|
Improve this doc
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<@ if doc.codepen @>
|
|
||||||
{% include codepen.html id="<$ doc.codepen $>" %}
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<@ endblock @>
|
<@ endblock @>
|
||||||
|
|
||||||
<!-- decorators -->
|
<!-- decorators -->
|
||||||
@ -141,9 +236,9 @@ docType: "<$ doc.docType $>"
|
|||||||
<h2>Supported platforms</h2>
|
<h2>Supported platforms</h2>
|
||||||
<@ block platforms @>
|
<@ block platforms @>
|
||||||
<ul>
|
<ul>
|
||||||
<@- for platform in prop.platforms @>
|
<@ for platform in prop.platforms -@>
|
||||||
<li><$ platform $></li>
|
<li><$ platform $></li>
|
||||||
<@ endfor -@>
|
<@- endfor @>
|
||||||
</ul>
|
</ul>
|
||||||
<@ endblock @>
|
<@ endblock @>
|
||||||
<!-- @platforms tag end -->
|
<!-- @platforms tag end -->
|
||||||
@ -181,12 +276,11 @@ docType: "<$ doc.docType $>"
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<@ for prop in doc.properties @>
|
<@ for prop in doc.properties -@>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
<$ prop.name $>
|
<$ prop.name $>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<@ if hasTypes @>
|
<@ if hasTypes @>
|
||||||
<td>
|
<td>
|
||||||
<$ prop.type.name $>
|
<$ prop.type.name $>
|
||||||
@ -197,86 +291,12 @@ docType: "<$ doc.docType $>"
|
|||||||
<$ prop.description $>
|
<$ prop.description $>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<@ endfor @>
|
<@- endfor @>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<@ endif @>
|
<@ endif @>
|
||||||
|
|
||||||
<@- if doc.statics.length -@>
|
<$ documentClass(doc) $>
|
||||||
<h2>Static Members</h2>
|
|
||||||
<@- for method in doc.statics @><@ if not method.internal @>
|
|
||||||
<div id="<$ method.name $>"></div>
|
|
||||||
<h3><$ functionSyntax(method) $></h3>
|
|
||||||
|
|
||||||
<@- if method.decorators @>
|
|
||||||
<@ for prop in method.decorators[0].argumentInfo @>
|
|
||||||
<@ if prop.platforms @>
|
|
||||||
<p>
|
|
||||||
<b>Platforms:</b>
|
|
||||||
<@- for platform in prop.platforms @>
|
|
||||||
<code><$ platform $></code>
|
|
||||||
<@ endfor -@>
|
|
||||||
</p>
|
|
||||||
<@ endif @>
|
|
||||||
<@ endfor @>
|
|
||||||
<@ endif -@>
|
|
||||||
|
|
||||||
<$ method.description $>
|
|
||||||
|
|
||||||
<@ if method.params @>
|
|
||||||
<$ paramTable(method.params) $>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<@ if method.this @>
|
|
||||||
<h4> Method's `this`
|
|
||||||
<$ method.this $>
|
|
||||||
</h4>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<@ if method.returns @>
|
|
||||||
<div class="return-value" markdown="1">
|
|
||||||
<i class="icon ion-arrow-return-left"></i>
|
|
||||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
|
||||||
</div>
|
|
||||||
<@ endif @>
|
|
||||||
<@ endif @>
|
|
||||||
<@ endfor -@>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<!-- methods on the class -->
|
|
||||||
<@- if doc.members and doc.members.length @>
|
|
||||||
|
|
||||||
<h2>Instance Members</h2>
|
|
||||||
<@- for method in doc.members @>
|
|
||||||
|
|
||||||
<div id="<$ method.name $>"></div>
|
|
||||||
|
|
||||||
<h3>
|
|
||||||
<$ functionSyntax(method) $>
|
|
||||||
</h3>
|
|
||||||
|
|
||||||
<$ method.description $>
|
|
||||||
|
|
||||||
<@ if method.params @>
|
|
||||||
<$ paramTable(method.params) $>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<@ if method.this @>
|
|
||||||
<h4> Method's `this`
|
|
||||||
<$ method.this $>
|
|
||||||
</h4>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<@ if method.returns @>
|
|
||||||
<div class="return-value" markdown="1">
|
|
||||||
<i class="icon ion-arrow-return-left"></i>
|
|
||||||
<b>Returns:</b> <$ typeInfo(method.returns) $>
|
|
||||||
</div>
|
|
||||||
<@ endif @>
|
|
||||||
|
|
||||||
<@ endfor -@>
|
|
||||||
|
|
||||||
<@- endif -@>
|
|
||||||
|
|
||||||
<@ block advanced @>
|
<@ block advanced @>
|
||||||
<@- if doc.advanced -@>
|
<@- if doc.advanced -@>
|
||||||
@ -285,6 +305,40 @@ docType: "<$ doc.docType $>"
|
|||||||
<@- endif -@>
|
<@- endif -@>
|
||||||
<@ endblock @>
|
<@ endblock @>
|
||||||
|
|
||||||
|
<!-- other classes -->
|
||||||
|
<@ for tag in doc.tags.tags -@>
|
||||||
|
<@ if tag.tagName == 'classes' -@>
|
||||||
|
<h2><a class="anchor" name="related-classes" href="#related-classes"></a>Related Classes</h2>
|
||||||
|
<@ set classes = tag.description.split('\n') @>
|
||||||
|
<@ for item in classes -@>
|
||||||
|
<@ if item.length > 1 @>
|
||||||
|
<@ for export in doc.moduleDoc.exports -@>
|
||||||
|
<@ if export.name == item @>
|
||||||
|
<h3><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h3>
|
||||||
|
<$ documentClass(export) $>
|
||||||
|
<@ endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<@ endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<@- endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<!-- end other classes -->
|
||||||
|
|
||||||
|
<!-- interfaces -->
|
||||||
|
<@ for tag in doc.tags.tags -@>
|
||||||
|
<@ if tag.tagName == 'interfaces' @>
|
||||||
|
<h2><a class="anchor" name="interfaces" href="#interfaces"></a>Interfaces</h2>
|
||||||
|
<@ set interfaces = tag.description.split('\n') @>
|
||||||
|
<@ for item in interfaces -@>
|
||||||
|
<@ if item.length > 1 @>
|
||||||
|
<h3><a class="anchor" name="<$ item $>" href="#<$ item $>"></a><$ item $></h3>
|
||||||
|
<$ interfaceTable(item) $>
|
||||||
|
<@ endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<@ endif @>
|
||||||
|
<@- endfor @>
|
||||||
|
<!-- end interfaces -->
|
||||||
|
|
||||||
<!-- related link -->
|
<!-- related link -->
|
||||||
<@- if doc.see @>
|
<@- if doc.see @>
|
||||||
|
|
||||||
|
@ -105,6 +105,9 @@ export interface CameraPopoverOptions {
|
|||||||
* // Handle error
|
* // Handle error
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* CameraOptions
|
||||||
|
* CameraPopoverOptions
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
plugin: 'cordova-plugin-camera',
|
plugin: 'cordova-plugin-camera',
|
||||||
|
@ -87,6 +87,33 @@ export const GoogleMapsAnimation = {
|
|||||||
* marker.showInfoWindow();
|
* marker.showInfoWindow();
|
||||||
* });
|
* });
|
||||||
* ```
|
* ```
|
||||||
|
* @interfaces
|
||||||
|
* AnimateCameraOptions
|
||||||
|
* CameraPosition
|
||||||
|
* MyLocation
|
||||||
|
* MyLocationOptions
|
||||||
|
* VisibleRegion
|
||||||
|
* GoogleMApsMarkerOptions
|
||||||
|
* GoogleMapsMarkerIcon
|
||||||
|
* GoogleMapsCircleOptions
|
||||||
|
* GoogleMapsPolylineOptions
|
||||||
|
* GoogleMapsPolygonOptions
|
||||||
|
* GoogleMapsTileOverlayOptions
|
||||||
|
* GoogleMapsGroundOverlayOptions
|
||||||
|
* GoogleMapsKmlOverlayOptions
|
||||||
|
* GeocoderRequest
|
||||||
|
* GeocoderResult
|
||||||
|
* @classes
|
||||||
|
* GoogleMapsMarker
|
||||||
|
* GoogleMapsCircle
|
||||||
|
* GoogleMapsPolyline
|
||||||
|
* GoogleMapsPolygon
|
||||||
|
* GoogleMapsTileOverlay
|
||||||
|
* GoogleMapsGroundOverlay
|
||||||
|
* GoogleMapsKmlOverlay
|
||||||
|
* GoogleMapsLatLngBounds
|
||||||
|
* GoogleMapsLatLng
|
||||||
|
* Geocoder
|
||||||
*/
|
*/
|
||||||
@Plugin({
|
@Plugin({
|
||||||
pluginRef: 'plugin.google.maps.Map',
|
pluginRef: 'plugin.google.maps.Map',
|
||||||
|
Loading…
Reference in New Issue
Block a user