Introduces import snippets for static functions

Adds snippets for import of modules and their
exported functions to the API documentation.
This commit is contained in:
Kai Volland
2019-04-03 17:06:42 +02:00
parent 7c1df60d06
commit 9860699d5f
2 changed files with 20 additions and 2 deletions

View File

@@ -27,6 +27,10 @@ var self = this;
</dt>
<dd class="<?js= (data.stability && data.stability !== 'stable') ? 'unstable' : '' ?>">
<?js if (data.parent && data.parent.kind == 'module' && data.parent.name.split('ol/').length < 3) { ?>
<pre class="prettyprint source"><code>import {<?js= data.name ?>} from '<?js= data.parent.name ?>';</code></pre>
<?js } ?>
<?js if (data.description) { ?>
<div class="description">
<?js= data.description ?>