Text file tour/template/action.tmpl

     1  {{/*{
     2  This is the action template.
     3  It determines how the formatting actions are rendered.
     4  */}}
     5  
     6  {{define "section"}}
     7    <h2>{{.Title}}</h2>
     8    {{range .Elem}}{{elem $.Template .}}{{end}}
     9  {{end}}
    10  
    11  {{define "list"}}
    12    <ul>
    13    {{range .Bullet}}
    14      <li>{{style .}}</li>
    15    {{end}}
    16    </ul>
    17  {{end}}
    18  
    19  {{define "text"}}
    20    {{if .Pre}}
    21    <pre>{{range .Lines}}{{.}}{{end}}</pre>
    22    {{else}}
    23    <p>
    24      {{range $i, $l := .Lines}}{{if $i}}{{template "newline"}}
    25      {{end}}{{style $l}}{{end}}
    26    </p>
    27    {{end}}
    28  {{end}}
    29  
    30  {{define "code"}}
    31  	{{if .Play}}
    32  		{{/* playable code is not displayed in the slides */}}
    33  	{{else}}
    34  		<div>{{.Text}}</div>
    35  	{{end}}
    36  {{end}}
    37  
    38  {{define "image"}}
    39    <img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}}>
    40  {{end}}
    41  
    42  {{define "link"}}
    43    <p class="link"><a href="{{.URL}}" target="_blank">{{style .Label}}</a></p>
    44  {{end}}
    45  
    46  {{define "html"}}{{.HTML}}{{end}}
    47  
    48  {{define "newline"}}
    49  {{/* No automatic line break. Paragraphs are free-form. */}}
    50  {{end}}
    51  

View as plain text