2014-05-05 15:55:27 -06:00
|
|
|
{/*
|
|
|
|
This is the action template.
|
|
|
|
It determines how the formatting actions are rendered.
|
|
|
|
*/}
|
|
|
|
|
|
|
|
{{define "section"}}
|
|
|
|
<h{{len .Number}} id="TOC_{{.FormattedNumber}}">{{.FormattedNumber}} {{.Title}}</h{{len .Number}}>
|
|
|
|
{{range .Elem}}{{elem $.Template .}}{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "list"}}
|
|
|
|
<ul>
|
|
|
|
{{range .Bullet}}
|
|
|
|
<li>{{style .}}</li>
|
|
|
|
{{end}}
|
|
|
|
</ul>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "text"}}
|
|
|
|
{{if .Pre}}
|
|
|
|
<div class="code"><pre>{{range .Lines}}{{.}}{{end}}</pre></div>
|
|
|
|
{{else}}
|
|
|
|
<p>
|
|
|
|
{{range $i, $l := .Lines}}{{if $i}}{{template "newline"}}
|
|
|
|
{{end}}{{style $l}}{{end}}
|
|
|
|
</p>
|
|
|
|
{{end}}
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "code"}}
|
2016-10-07 14:27:53 -06:00
|
|
|
<div class="code{{if playable .}} playground{{end}}" {{if .Edit}}contenteditable="true" spellcheck="false"{{end}}>{{.Text}}</div>
|
2014-05-05 15:55:27 -06:00
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "image"}}
|
|
|
|
<div class="image">
|
|
|
|
<img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}}>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2016-01-10 15:03:33 -07:00
|
|
|
{{define "video"}}
|
|
|
|
<div class="video">
|
|
|
|
<video {{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}} controls>
|
|
|
|
<source src="{{.URL}}" type="{{.SourceType}}">
|
|
|
|
</video>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2016-01-06 17:52:04 -07:00
|
|
|
{{define "background"}}
|
|
|
|
<div class="background">
|
|
|
|
<img src="{{.URL}}">
|
|
|
|
</div>
|
|
|
|
{{end}}
|
|
|
|
|
2014-05-05 15:55:27 -06:00
|
|
|
{{define "iframe"}}
|
|
|
|
<iframe src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}}></iframe>
|
|
|
|
{{end}}
|
|
|
|
|
|
|
|
{{define "link"}}<p class="link"><a href="{{.URL}}" target="_blank">{{style .Label}}</a></p>{{end}}
|
|
|
|
|
|
|
|
{{define "html"}}{{.HTML}}{{end}}
|
2014-07-15 09:23:16 -06:00
|
|
|
|
2016-01-06 17:52:04 -07:00
|
|
|
{{define "caption"}}<figcaption>{{style .Text}}</figcaption>{{end}}
|