jsdoc: generate modules for sensor groups; customize yuidoc templates for displaying sensor groups by categories & connection types

Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>
This commit is contained in:
Heidi Pan
2015-05-21 10:09:48 -07:00
committed by Mihai Tudor Panu
parent ed52f0e5cb
commit 33b508110e
14 changed files with 2150 additions and 116 deletions

View File

@ -0,0 +1,205 @@
<h1>{{name}} Class</h1>
<div class="box meta">
{{#if uses}}
<div class="uses">
Uses
<ul class="inline commas">
{{#uses}}
<li><a href="{{.}}.html">{{.}}</a></li>
{{/uses}}
</ul>
</div>
{{/if}}
{{#if extends}}
<div class="extends">
Extends {{#crossLink extends}}{{/crossLink}}
</div>
{{/if}}
{{#if foundAt}}
<div class="foundat">
Defined in: <a href="{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
</div>
{{/if}}
{{#if module}}
{{#if submodule}}
Module: {{#crossLinkModule submodule}}{{/crossLinkModule}}<br>
Parent Module: {{#crossLinkModule module}}{{/crossLinkModule}}
{{else}}
Module: {{#crossLinkModule module}}{{/crossLinkModule}}
{{/if}}
{{/if}}
{{#if since}}
<p>Available since {{since}}</p>
{{/if}}
</div>
{{#if deprecated}}
<div class="box deprecated">
<p>
{{#if deprecationMessage}}
<strong>Deprecated:</strong> {{deprecationMessage}}
{{else}}
This class is deprecated.
{{/if}}
</p>
</div>
{{/if}}
<div class="box intro">
{{{classDescription}}}
</div>
{{#is_constructor}}
<div class="constructor">
<h2>Constructor</h2>
{{>method}}
</div>
{{/is_constructor}}
<div id="classdocs" class="tabview">
<ul class="api-class-tabs">
<li class="api-class-tab index"><a href="#index">Index</a></li>
{{#if methods}}
<li class="api-class-tab methods"><a href="#methods">Methods</a></li>
{{/if}}
{{#if properties}}
<li class="api-class-tab properties"><a href="#properties">Properties</a></li>
{{/if}}
{{#if attrs}}
<li class="api-class-tab attrs"><a href="#attrs">Attributes</a></li>
{{/if}}
{{#if events}}
<li class="api-class-tab events"><a href="#events">Events</a></li>
{{/if}}
</ul>
<div>
<div id="index" class="api-class-tabpanel index">
<h2 class="off-left">Item Index</h2>
{{#if methods}}
<div class="index-section methods">
<h3>Methods</h3>
<ul class="index-list methods{{#if extends}} extends{{/if}}">
{{#methods}}
<li class="index-item method{{#if access}} {{access}}{{/if}}{{#if deprecated}} deprecated{{/if}}{{#if overwritten_from}} inherited{{/if}}{{#if extended_from}} inherited{{/if}}">
<a href="#method_{{name}}">{{name}}</a>
{{#if static}}
<span class="flag static">static</span>
{{/if}}
{{#if deprecated}}
<span class="flag deprecated">deprecated</span>
{{/if}}
</li>
{{/methods}}
</ul>
</div>
{{/if}}
{{#if properties}}
<div class="index-section properties">
<h3>Properties</h3>
<ul class="index-list properties{{#if extends}} extends{{/if}}">
{{#properties}}
<li class="index-item property{{#if access}} {{access}}{{/if}}{{#if deprecated}} deprecated{{/if}}{{#if overwritten_from}} inherited{{/if}}{{#if extended_from}} inherited{{/if}}">
<a href="#property_{{name}}">{{name}}</a>
{{#if static}}
<span class="flag static">static</span>
{{/if}}
{{#if deprecated}}
<span class="flag deprecated">deprecated</span>
{{/if}}
</li>
{{/properties}}
</ul>
</div>
{{/if}}
{{#if attrs}}
<div class="index-section attrs">
<h3>Attributes</h3>
<ul class="index-list attrs{{#if extends}} extends{{/if}}">
{{#attrs}}
<li class="index-item attr{{#if access}} {{access}}{{/if}}{{#if deprecated}} deprecated{{/if}}{{#if overwritten_from}} inherited{{/if}}{{#if extended_from}} inherited{{/if}}">
<a href="#attr_{{name}}">{{name}}</a>
</li>
{{/attrs}}
</ul>
</div>
{{/if}}
{{#if events}}
<div class="index-section events">
<h3>Events</h3>
<ul class="index-list events{{#if extends}} extends{{/if}}">
{{#events}}
<li class="index-item event{{#if access}} {{access}}{{/if}}{{#if deprecated}} deprecated{{/if}}{{#if overwritten_from}} inherited{{/if}}{{#if extended_from}} inherited{{/if}}">
<a href="#event_{{name}}">{{name}}</a>
{{#if static}}
<span class="flag static">static</span>
{{/if}}
{{#if deprecated}}
<span class="flag deprecated">deprecated</span>
{{/if}}
</li>
{{/events}}
</ul>
</div>
{{/if}}
</div>
{{#if methods}}
<div id="methods" class="api-class-tabpanel">
<h2 class="off-left">Methods</h2>
{{#methods}}
{{>method}}
{{/methods}}
</div>
{{/if}}
{{#if properties}}
<div id="properties" class="api-class-tabpanel">
<h2 class="off-left">Properties</h2>
{{#properties}}
{{>props}}
{{/properties}}
</div>
{{/if}}
{{#if attrs}}
<div id="attrs" class="api-class-tabpanel">
<h2 class="off-left">Attributes</h2>
{{#attrs}}
{{>attrs}}
{{/attrs}}
</div>
{{/if}}
{{#if events}}
<div id="events" class="api-class-tabpanel">
<h2 class="off-left">Events</h2>
{{#events}}
{{>events}}
{{/events}}
</div>
{{/if}}
</div>
</div>
{{{customCrossLinks}}}

View File

@ -0,0 +1,212 @@
<div id="method_{{name}}" class="method item{{#if access}} {{access}}{{/if}}{{#if deprecated}} deprecated{{/if}}{{#if extended_from}} inherited{{/if}}">
<h3 class="name"><code>{{name}}</code></h3>
{{#if params}}
<div class="args">
<span class="paren">(</span><ul class="args-list inline commas">
{{#params}}
<li class="arg">
{{#if optional}}
<code class="optional">[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]</code>
{{else}}
<code>{{name}}</code>
{{/if}}
</li>
{{/params}}
</ul><span class="paren">)</span>
</div>
{{else}}
<span class="paren">()</span>
{{/if}}
{{#if return}}
<span class="returns-inline">
<span class="type">{{#crossLink returnType}}{{/crossLink}}</span>
</span>
{{/if}}
{{#if deprecated}}
<span class="flag deprecated"{{#if deprecationMessage}} title="{{deprecationMessage}}"{{/if}}>deprecated</span>
{{/if}}
{{#if access}}
<span class="flag {{access}}">{{access}}</span>
{{/if}}
{{#if final}}
<span class="flag final">final</span>
{{/if}}
{{#if static}}
<span class="flag static">static</span>
{{/if}}
{{#if chainable}}
<span class="flag chainable">chainable</span>
{{/if}}
{{#if async}}
<span class="flag async">async</span>
{{/if}}
<div class="meta">
{{#if overwritten_from}}
<p>Inherited from
<a href="{{crossLinkRaw overwritten_from/class}}#method_{{overwritten_from/name}}">
{{overwritten_from/class}}
</a>
{{#if foundAt}}
but overwritten in
{{/if}}
{{else}}
{{#if extended_from}}
<p>Inherited from
<a href="{{crossLinkRaw extended_from}}#method_{{name}}">{{extended_from}}</a>:
{{else}}
{{#providedBy}}
<p>Provided by the <a href="../modules/{{.}}.html">{{.}}</a> module.</p>
{{/providedBy}}
<p>
{{#if foundAt}}
Defined in
{{/if}}
{{/if}}
{{/if}}
{{#if foundAt}}
<a href="{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
{{/if}}
</p>
{{#if deprecationMessage}}
<p>Deprecated: {{deprecationMessage}}</p>
{{/if}}
{{#if since}}
<p>Available since {{since}}</p>
{{/if}}
</div>
<div class="description">
{{{methodDescription}}}
</div>
{{#if params}}
<div class="params">
<h4>Parameters:</h4>
<ul class="params-list">
{{#params}}
<li class="param">
{{#if optional}}
<code class="param-name optional">[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
{{else}}
<code class="param-name">{{name}}</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
{{/if}}
{{#if multiple}}
<span class="flag multiple" title="This argument may occur one or more times.">multiple</span>
{{/if}}
<div class="param-description">
{{{description}}}
</div>
{{#if props}}
<ul class="params-list">
{{#props}}
<li class="param">
{{#if optional}}
<code class="param-name optional">[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
{{else}}
<code class="param-name">{{name}}</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
{{/if}}
<div class="param-description">
{{{description}}}
</div>
{{#if props}}
<ul class="params-list">
{{#props}}
<li class="param">
{{#if optional}}
<code class="param-name optional">[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
<span class="flag optional" title="This parameter is optional.">optional</span>
{{else}}
<code class="param-name">{{name}}</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
{{/if}}
<div class="param-description">
{{{description}}}
</div>
</li>
{{/props}}
</ul>
{{/if}}
</li>
{{/props}}
</ul>
{{/if}}
</li>
{{/params}}
</ul>
</div>
{{/if}}
{{#return}}
<div class="returns">
<h4>Returns:</h4>
<div class="returns-description">
{{#if description}}
{{#if type}}
<span class="type">{{#crossLink type}}{{/crossLink}}</span>:
{{/if}}
{{{description}}}
{{else}}
{{#if type}}
<span class="type">{{#crossLink type}}{{/crossLink}}</span>:
{{/if}}
{{/if}}
</div>
</div>
{{/return}}
{{#throws}}
<div class="throws">
<h4>Throws:</h4>
<div class="throws-description">
{{#if description}}
{{#if type}}
<span class="type">{{#crossLink type}}{{/crossLink}}</span>:
{{/if}}
{{{description}}}
{{else}}
{{#if type}}
<span class="type">{{#crossLink type}}{{/crossLink}}</span>:
{{/if}}
{{/if}}
</div>
</div>
{{/throws}}
{{#example}}
<div class="example">
<h4>Example:</h4>
<div class="example-content">
{{{.}}}
</div>
</div>
{{/example}}
</div>

View File

@ -0,0 +1,92 @@
<h1>{{name}} Module</h1>
<div class="box clearfix meta">
{{#extra}}
{{#selleck}}
<a class="button link-docs" href="/yui/docs/{{name}}">User Guide &amp; Examples</a>
{{/selleck}}
{{/extra}}
{{#if requires}}
<div class="uses">
Requires
<ul class="inline commas">
{{#requires}}
<li>{{#crossLinkModule .}}{{/crossLinkModule}}</li>
{{/requires}}
</ul>
</div>
{{/if}}
{{#if foundAt}}
<div class="foundat">
Defined in: <a href="{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
</div>
{{/if}}
{{#if since}}
<p>Available since {{since}}</p>
{{/if}}
</div>
{{#if deprecated}}
<div class="box deprecated">
<p>
{{#if deprecationMessage}}
<strong>Deprecated:</strong> {{deprecationMessage}}
{{else}}
This module is deprecated.
{{/if}}
</p>
</div>
{{/if}}
<div class="box intro">
{{{moduleDescription}}}
</div>
{{#example}}
<div class="example">
<h4>Example:</h4>
<div class="example-content">
{{{.}}}
</div>
</div>
{{/example}}
<div class="yui3-g">
<div class="yui3-u-1-2">
{{#if moduleClasses}}
<p>This module provides the following classes:</p>
<ul class="module-classes">
{{#moduleClasses}}
<li class="module-class">
<a href="{{../projectRoot}}classes/{{name}}.html">
{{displayName}}
</a>
</li>
{{/moduleClasses}}
</ul>
{{/if}}
</div>
<div class="yui3-u-1-2">
{{#if subModules}}
<p>This module is a rollup of the following modules:</p>
<ul class="module-submodules">
{{#subModules}}
<li class="module-submodule">
<a href="{{../projectRoot}}modules/{{name}}.html">
{{displayName}}
</a>
<div class="module-submodule-description">
{{{description}}}
</div>
</li>
{{/subModules}}
</ul>
{{/if}}
</div>
</div>

View File

@ -0,0 +1,22 @@
<div id="api-options" hidden>
Show:
<label for="api-show-inherited">
<input type="checkbox" id="api-show-inherited" checked>
Inherited
</label>
<label for="api-show-protected">
<input type="checkbox" id="api-show-protected">
Protected
</label>
<label for="api-show-private">
<input type="checkbox" id="api-show-private">
Private
</label>
<label for="api-show-deprecated">
<input type="checkbox" id="api-show-deprecated">
Deprecated
</label>
</div>

View File

@ -0,0 +1,119 @@
<div id="property_{{name}}" class="property item{{#if access}} {{access}}{{/if}}{{#if deprecated}} deprecated{{/if}}{{#if extended_from}} inherited{{/if}}">
<h3 class="name"><code>{{name}}</code></h3>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
{{#if deprecated}}
<span class="flag deprecated"{{#if deprecationMessage}} title="{{deprecationMessage}}"{{/if}}>deprecated</span>
{{/if}}
{{#if access}}
<span class="flag {{access}}">{{access}}</span>
{{/if}}
{{#if final}}
<span class="flag final">final</span>
{{/if}}
{{#if static}}
<span class="flag static">static</span>
{{/if}}
<div class="meta">
{{#if overwritten_from}}
<p>Inherited from
<a href="{{crossLinkRaw overwritten_from/class}}#property_{{overwritten_from/name}}">
{{overwritten_from/class}}
</a>
{{#if foundAt}}
but overwritten in
{{/if}}
{{else}}
{{#if extended_from}}
<p>Inherited from
<a href="{{crossLinkRaw extended_from}}#property_{{name}}">{{extended_from}}</a>:
{{else}}
{{#providedBy}}
<p>Provided by the <a href="../modules/{{.}}.html">{{.}}</a> module.</p>
{{/providedBy}}
<p>
{{#if foundAt}}
Defined in
{{/if}}
{{/if}}
{{/if}}
{{#if foundAt}}
<a href="{{foundAt}}">`{{{file}}}:{{{line}}}`</a>
{{/if}}
</p>
{{#if deprecationMessage}}
<p>Deprecated: {{deprecationMessage}}</p>
{{/if}}
{{#if since}}
<p>Available since {{since}}</p>
{{/if}}
</div>
<div class="description">
{{{propertyDescription}}}
</div>
{{#if default}}
<p><strong>Default:</strong> {{default}}</p>
{{/if}}
{{#example}}
<div class="example">
<h4>Example:</h4>
<div class="example-content">
{{{.}}}
</div>
</div>
{{/example}}
{{#if subprops}}
<h4>Sub-properties:</h4>
<ul class="params-list">
{{#subprops}}
<li class="param">
{{#if optional}}
<code class="param-name optional">[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
<span class="flag optional" title="This property is optional.">optional</span>
{{else}}
<code class="param-name">{{name}}</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
{{/if}}
<div class="param-description">
{{{description}}}
</div>
{{#if subprops}}
<ul class="params-list">
{{#subprops}}
<li class="param">
{{#if optional}}
<code class="param-name optional">[{{name}}{{#if optdefault}}={{optdefault}}{{/if}}]</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
<span class="flag optional" title="This property is optional.">optional</span>
{{else}}
<code class="param-name">{{name}}</code>
<span class="type">{{#crossLink type}}{{/crossLink}}</span>
{{/if}}
<div class="param-description">
{{{description}}}
</div>
</li>
{{/subprops}}
</ul>
{{/if}}
</li>
{{/subprops}}
</ul>
{{/if}}
</div>

View File

@ -0,0 +1,27 @@
<div id="api-list">
<h2 class="off-left">APIs</h2>
<div id="api-tabview" class="tabview">
<ul class="tabs">
<li><a href="#api-categories">By Category</a></li>
<li><a href="#api-connections">By Connection Type</a></li>
</ul>
<div id="api-tabview-filter">
<input type="search" id="api-filter" placeholder="Type to filter APIs" hidden>
</div>
<div id="api-tabview-panel">
<ul id="api-categories" class="apis modules">
{{{listByCategory}}}
</ul>
<ul id="api-connections" class="apis modules">
{{{listByConnection}}}
</ul>
</div>
</div>
{{{javascripts}}}
</div>