github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/tools/cmd/present/templates/action.tmpl (about)

     1  {/*
     2  This is the action template.
     3  It determines how the formatting actions are rendered.
     4  */}
     5  
     6  {{define "section"}}
     7    <h{{len .Number}} id="TOC_{{.FormattedNumber}}">{{.FormattedNumber}} {{.Title}}</h{{len .Number}}>
     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    <div class="code"><pre>{{range .Lines}}{{.}}{{end}}</pre></div>
    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    <div class="code{{if playable .}} playground{{end}}" contenteditable="true" spellcheck="false">{{.Text}}</div>
    32  {{end}}
    33  
    34  {{define "image"}}
    35  <div class="image">
    36    <img src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}}>
    37  </div>
    38  {{end}}
    39  
    40  {{define "iframe"}}
    41  <iframe src="{{.URL}}"{{with .Height}} height="{{.}}"{{end}}{{with .Width}} width="{{.}}"{{end}}></iframe>
    42  {{end}}
    43  
    44  {{define "link"}}<p class="link"><a href="{{.URL}}" target="_blank">{{style .Label}}</a></p>{{end}}
    45  
    46  {{define "html"}}{{.HTML}}{{end}}
    47  
    48  {{define "caption"}}<figcaption>{{style .Text}}</figcaption>{{end}}