Skip to content

Commit

Permalink
docs(): fix code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mhartington committed Dec 29, 2015
1 parent 760b70d commit 38e4e3b
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 61 deletions.
30 changes: 15 additions & 15 deletions config/docs/templates/api/api.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@
---

<div class="improve-docs">
<a href='http://github.com/driftyco/ionic/tree/master/<$ doc.relativePath $>#L<$ doc.startingLine $>'>
View Source
</a>
&nbsp;
<a href='http://github.com/driftyco/ionic/edit/master/<$ doc.relativePath $>#L<$ doc.startingLine $>'>
Improve this doc
</a>
<a href='http://github.com/driftyco/ionic/tree/master/<$ doc.relativePath $>#L<$ doc.startingLine $>'>
View Source
</a>
&nbsp;
<a href='http://github.com/driftyco/ionic/edit/master/<$ doc.relativePath $>#L<$ doc.startingLine $>'>
Improve this doc
</a>
</div>

<@ block content @>

<@ block header @>
<h1 class="api-title">
<@ if doc.docType == "directive" @>
<$ doc.name | dashCase $>
<$ doc.name | dashCase $>
<@ else @>
<$ doc.name $>
<$ doc.name $>
<@ endif @>
<@ if doc.parent @>
<br />
<small>
Child of <$ doc.parent $>
Child of <$ doc.parent $>
</small>
<@ endif @>
<@ if doc.delegate @>
<br/>
<small>
Delegate: <$ doc.delegate $>
Delegate: <$ doc.delegate $>
</small>
<@ endif @>
</h1>
Expand All @@ -50,16 +50,16 @@ <h1 class="api-title">

<@ if doc.deprecated @>
<fieldset class="deprecated">
<legend>Deprecated API</legend>
<$ doc.deprecated| marked $>
<legend>Deprecated API</legend>
<$ doc.deprecated| marked $>
</fieldset>
<@ endif @>

<@ block dependencies @>
<@- if doc.requires @>
<h2 id="dependencies">Dependencies</h2>
<ul>
<@ for require in doc.requires @><li><$ require | link $></li><@ endfor @>
<@ for require in doc.requires @><li><$ require | link $></li><@ endfor @>
</ul>
<@ endif -@>
<@ endblock @>
Expand All @@ -71,7 +71,7 @@ <h2 id="dependencies">Dependencies</h2>
<@- if doc.examples @>
<h2 id="example">Example</h2>
<@- for example in doc.examples -@>
<$ example | marked $>
<$ example | marked $>
<@- endfor -@>
<@ endif -@>
<@ endblock @>
Expand Down
90 changes: 45 additions & 45 deletions config/docs/templates/api/directive.template.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,54 +3,54 @@

<@ block additional @>

<@ block usage @>
<@ block usage @>
<h2 id="usage">Usage</h2>
<@ if doc.usage @>
<@ if doc.usage @>
<$ doc.usage $>
<@ else @>
<@ if doc.restrict.element @>

```html
<<$ doc.name | dashCase $>
<@- for param in doc.params @>
<$ directiveParam(param.alias or param.name, param.type, '="', '"') $>
<@- endfor @>>
...
</<$ doc.name | dashCase $>>
```
<@ endif -@>

<@- if doc.restrict.attribute -@>

```html
<<$ doc.element $>
<@- for param in doc.params @>
<$ directiveParam(param.name, param.type, '="', '"') $>
<@- endfor @>>
...
</<$ doc.element $>>
```
<@ endif -@>

<@- if doc.restrict.cssClass -@>

```html
<@ set sep = joiner(' ') @>
<<$ doc.element $> class="
<@- for param in doc.params -@>
<$ sep() $><$ directiveParam(param.name, param.type, ': ', ';') $>
<@- endfor @>"> ... </<$ doc.element $>>
```
<@ endif -@>

<@- endif @>
<@ endblock -@>


<@ if doc.params @>
<@ else @>
<@ if doc.restrict.element @>

```html
<<$ doc.name | dashCase $>
<@- for param in doc.params @>
<$ directiveParam(param.alias or param.name, param.type, '="', '"') $>
<@- endfor @>>
...
</<$ doc.name | dashCase $>>
```
<@ endif -@>

<@- if doc.restrict.attribute -@>

```html
<<$ doc.element $>
<@- for param in doc.params @>
<$ directiveParam(param.name, param.type, '="', '"') $>
<@- endfor @>>
...
</<$ doc.element $>>
```
<@ endif -@>

<@- if doc.restrict.cssClass -@>

```html
<@ set sep = joiner('&nbsp;') @>
<<$ doc.element $> class="
<@- for param in doc.params -@>
<$ sep() $><$ directiveParam(param.name, param.type, ': ', ';') $>
<@- endfor @>"> ... </<$ doc.element $>>
```
<@ endif -@>

<@- endif @>
<@ endblock -@>


<@ if doc.params @>
<h2 id="api" style="clear:both;">API</h2>
<$ paramTable(doc.params, true) $>
<@ endif @>
<@ endif @>

<@ include "lib/events.template.html" @>
<@ include "lib/events.template.html" @>
<@ endblock @>
2 changes: 1 addition & 1 deletion config/docs/templates/lib/macros.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
<@ endmacro -@>

<@- macro functionSyntax(fn) @>
<@- set sep = joiner(', ') -@>
<@- set sep = joiner(',&nbsp;') -@>
<code><$ fn.name $>(<@- for param in fn.params @><$ sep() $>
<@- if param.type.optional @>[<@ endif -@>
<$ param.name $>
Expand Down

0 comments on commit 38e4e3b

Please sign in to comment.