docs(sass): add sass processor

This commit is contained in:
Brian Dennis
2016-08-04 10:23:06 -05:00
parent d7ce5709ce
commit d5da8ab0e2
5 changed files with 213 additions and 2 deletions

View File

@ -145,6 +145,52 @@ angular_controller: APIDemoCtrl <@ endif @>
<$ typeList(fn.typeList) $> <$ fn.description | marked $>
<@- endmacro -@>
<@- macro sassTable(files) -@>
<div id="sass-variables" ng-controller="SassToggleCtrl">
<div class="sass-platform-toggle">
<@ if files.length > 1 @>
<@ for file in files @>
<@ if loop.first @>
<a ng-init="setSassPlatform('<$ file.platform $>')" ng-class="{ active: active === '<$ file.platform $>' }" ng-click="setSassPlatform('<$ file.platform $>')" ><$ file.platform | platform $></a>
<@ else @>
<a ng-class="{ active: active === '<$ file.platform $>' }" ng-click="setSassPlatform('<$ file.platform $>')"><$ file.platform | platform $></a>
<@ endif @>
<@ endfor @>
<@ else @>
<h3 ng-init="setSassPlatform('<$ files[0].platform $>')"><$ files[0].platform | platform $></h3>
<@ endif @>
</div>
<@ for file in files @>
<table ng-show="active === '<$ file.platform $>'" id="sass-<$file.platform $>" class="table param-table" style="margin:0;">
<thead>
<tr>
<th>Property</th>
<th>Default</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<@ for prop in file.props @>
<tr>
<td><$ prop.name $></td>
<@ if prop.default @>
<td><$ prop.default | code $></td>
<@ else @>
<td>
</td>
<@ endif @>
<td><$ prop.description | marked $></td>
</tr>
<@ endfor @>
</tbody>
</table>
<@ endfor @>
</div>
<@- endmacro -@>
<@ block body @>
@ -194,7 +240,6 @@ Improve this doc
<@ endblock @>
<!-- @usage tag -->
<@ if doc.usage @>
<h2><a class="anchor" name="usage" href="#usage"></a>Usage</h2>
@ -339,6 +384,11 @@ Improve this doc
<@- endif -@>
<@ endblock @>
<@ if doc.sassVariables @>
<h2 id="sass-variable-header"><a class="anchor" name="sass-variables" href="#sass-variables"></a>Sass Variables</h2>
<$ sassTable(doc.sassVariables) $>
<@ endif @>
<!-- related link -->
<@- if doc.see @>