~shulhan/asciidoctor-go

ref: v0.1.0 asciidoctor-go/html_template.go -rw-r--r-- 2.1 KiB
4c1ded16Shulhan Release asciidoctor-go v0.1.0 (2021-03-06) 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// Copyright 2020, Shulhan <ms@kilabit.info>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

package asciidoctor

//
// HTML templates for head, meta attributes, and footers.
//
const (
	_htmlBegin = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="asciidoctor-go">`
)

const (
	_htmlPreambleBegin = `
<div id="preamble">
<div class="sectionbody">`
)

//
// HTML templates for table of contents.
//
const (
	_htmlToCBegin = `
<div id="toc" class="%s">
<div id="toctitle">%s</div>`
)

//
// HTML templates for adminition block.
//
const (
	_htmlAdmonitionIconsFont = `
<i class="fa icon-%s" title=%q></i>`

	_htmlAdmonitionContent = `
</td>
<td class="content">
%s`

	_htmlAdmonitionEnd = `
</td>
</tr>
</table>
</div>`
)

const (
	// Parameters: src, autoplay, controls, loop.
	_htmlBlockAudio = `
<audio src="%s"%s%s%s>
Your browser does not support the audio tag.
</audio>
</div>
</div>`
)

//
// HTML templates for block image.
//
const (
	_htmlBlockImage = `
<div class="content">
<img src=%q alt=%q%s%s>
</div>`
)

// Block video.
const (
	// List of parameters in order: src, width, height, poster, controls,
	// autoplay, loop.
	_htmlBlockVideo = `
<video src="%s"%s%s%s%s%s%s>
Your browser does not support the video tag.
</video>`

	// List of parameters in order: width, height, src, allowfullscreen.
	_htmlBlockVideoYoutube = `
<iframe%s%s src="%s" frameborder="0"%s></iframe>`

	// List of parameters in order: width, height, src.
	_htmlBlockVideoVimeo = `
<iframe%s%s src="%s" frameborder="0"></iframe>`
)

const (
	_htmlBlockLiteralContent = `
<div class="content">
<pre>%s</pre>
</div>
</div>`
)

//
// HTML templates for list description.
//
const (
	_htmlListDescriptionItemBegin = `
<dt class="hdlist1">%s</dt>
<dd>`

	_htmlListDescriptionItemQandABegin = `
<li>
<p><em>%s</em></p>`

	_htmlListDescriptionItemHorizontalBegin = `
<tr>
<td class="hdlist1">
%s
</td>
<td class="hdlist2">`
)