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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
|
// Code generated by qtc from "code.qtpl". DO NOT EDIT.
// See https://github.com/valyala/quicktemplate for details.
// The code layout.
//line template/code.qtpl:2
package template
//line template/code.qtpl:2
import (
qtio422016 "io"
qt422016 "github.com/valyala/quicktemplate"
)
//line template/code.qtpl:2
var (
_ = qtio422016.Copy
_ = qt422016.AcquireByteBuffer
)
//line template/code.qtpl:2
func StreamCode(qw422016 *qt422016.Writer, lang, data string) {
//line template/code.qtpl:2
qw422016.N().S(`
`)
//line template/code.qtpl:3
streamlayout(qw422016, code_css(), code_scripts(lang), "", code_contents(lang, data), code_bodyscripts(lang))
//line template/code.qtpl:3
qw422016.N().S(`
`)
//line template/code.qtpl:4
}
//line template/code.qtpl:4
func WriteCode(qq422016 qtio422016.Writer, lang, data string) {
//line template/code.qtpl:4
qw422016 := qt422016.AcquireWriter(qq422016)
//line template/code.qtpl:4
StreamCode(qw422016, lang, data)
//line template/code.qtpl:4
qt422016.ReleaseWriter(qw422016)
//line template/code.qtpl:4
}
//line template/code.qtpl:4
func Code(lang, data string) string {
//line template/code.qtpl:4
qb422016 := qt422016.AcquireByteBuffer()
//line template/code.qtpl:4
WriteCode(qb422016, lang, data)
//line template/code.qtpl:4
qs422016 := string(qb422016.B)
//line template/code.qtpl:4
qt422016.ReleaseByteBuffer(qb422016)
//line template/code.qtpl:4
return qs422016
//line template/code.qtpl:4
}
//line template/code.qtpl:7
const prefix = "https://unpkg.com/prismjs"
// The code scripts.
//line template/code.qtpl:11
func streamcode_scripts(qw422016 *qt422016.Writer, lang string) {
//line template/code.qtpl:11
qw422016.N().S(`
<link rel='stylesheet' crossorigin='anonymous' href='`)
//line template/code.qtpl:12
qw422016.E().S(prefix)
//line template/code.qtpl:12
qw422016.N().S(`/themes/prism.css' />
`)
//line template/code.qtpl:13
}
//line template/code.qtpl:13
func writecode_scripts(qq422016 qtio422016.Writer, lang string) {
//line template/code.qtpl:13
qw422016 := qt422016.AcquireWriter(qq422016)
//line template/code.qtpl:13
streamcode_scripts(qw422016, lang)
//line template/code.qtpl:13
qt422016.ReleaseWriter(qw422016)
//line template/code.qtpl:13
}
//line template/code.qtpl:13
func code_scripts(lang string) string {
//line template/code.qtpl:13
qb422016 := qt422016.AcquireByteBuffer()
//line template/code.qtpl:13
writecode_scripts(qb422016, lang)
//line template/code.qtpl:13
qs422016 := string(qb422016.B)
//line template/code.qtpl:13
qt422016.ReleaseByteBuffer(qb422016)
//line template/code.qtpl:13
return qs422016
//line template/code.qtpl:13
}
// The code bodyscripts.
//line template/code.qtpl:16
func streamcode_bodyscripts(qw422016 *qt422016.Writer, lang string) {
//line template/code.qtpl:16
qw422016.N().S(`
`)
//line template/code.qtpl:17
qw422016.N().S(`<script src='`)
//line template/code.qtpl:18
qw422016.E().S(prefix)
//line template/code.qtpl:18
qw422016.N().S(`/prism.js'></script>`)
//line template/code.qtpl:19
if lang != "" && lang != "none" {
//line template/code.qtpl:19
qw422016.N().S(`<script src='`)
//line template/code.qtpl:20
qw422016.E().S(prefix)
//line template/code.qtpl:20
qw422016.N().S(`/components/prism-`)
//line template/code.qtpl:20
qw422016.E().S(lang)
//line template/code.qtpl:20
qw422016.N().S(`.js'></script>`)
//line template/code.qtpl:21
}
//line template/code.qtpl:22
qw422016.N().S(`
`)
//line template/code.qtpl:23
}
//line template/code.qtpl:23
func writecode_bodyscripts(qq422016 qtio422016.Writer, lang string) {
//line template/code.qtpl:23
qw422016 := qt422016.AcquireWriter(qq422016)
//line template/code.qtpl:23
streamcode_bodyscripts(qw422016, lang)
//line template/code.qtpl:23
qt422016.ReleaseWriter(qw422016)
//line template/code.qtpl:23
}
//line template/code.qtpl:23
func code_bodyscripts(lang string) string {
//line template/code.qtpl:23
qb422016 := qt422016.AcquireByteBuffer()
//line template/code.qtpl:23
writecode_bodyscripts(qb422016, lang)
//line template/code.qtpl:23
qs422016 := string(qb422016.B)
//line template/code.qtpl:23
qt422016.ReleaseByteBuffer(qb422016)
//line template/code.qtpl:23
return qs422016
//line template/code.qtpl:23
}
// The code css.
//line template/code.qtpl:26
func streamcode_css(qw422016 *qt422016.Writer) {
//line template/code.qtpl:26
qw422016.N().S(`
<style>
pre[class*="language-"] code[class*="language-"] {
white-space: pre-wrap;
}
</style>
`)
//line template/code.qtpl:32
}
//line template/code.qtpl:32
func writecode_css(qq422016 qtio422016.Writer) {
//line template/code.qtpl:32
qw422016 := qt422016.AcquireWriter(qq422016)
//line template/code.qtpl:32
streamcode_css(qw422016)
//line template/code.qtpl:32
qt422016.ReleaseWriter(qw422016)
//line template/code.qtpl:32
}
//line template/code.qtpl:32
func code_css() string {
//line template/code.qtpl:32
qb422016 := qt422016.AcquireByteBuffer()
//line template/code.qtpl:32
writecode_css(qb422016)
//line template/code.qtpl:32
qs422016 := string(qb422016.B)
//line template/code.qtpl:32
qt422016.ReleaseByteBuffer(qb422016)
//line template/code.qtpl:32
return qs422016
//line template/code.qtpl:32
}
// The code contents.
//line template/code.qtpl:35
func streamcode_contents(qw422016 *qt422016.Writer, lang, data string) {
//line template/code.qtpl:35
qw422016.N().S(`
<pre><code class='language-`)
//line template/code.qtpl:36
qw422016.E().S(lang)
//line template/code.qtpl:36
qw422016.N().S(`'>`)
//line template/code.qtpl:36
qw422016.E().S(data)
//line template/code.qtpl:36
qw422016.N().S(`</code></pre>
`)
//line template/code.qtpl:37
}
//line template/code.qtpl:37
func writecode_contents(qq422016 qtio422016.Writer, lang, data string) {
//line template/code.qtpl:37
qw422016 := qt422016.AcquireWriter(qq422016)
//line template/code.qtpl:37
streamcode_contents(qw422016, lang, data)
//line template/code.qtpl:37
qt422016.ReleaseWriter(qw422016)
//line template/code.qtpl:37
}
//line template/code.qtpl:37
func code_contents(lang, data string) string {
//line template/code.qtpl:37
qb422016 := qt422016.AcquireByteBuffer()
//line template/code.qtpl:37
writecode_contents(qb422016, lang, data)
//line template/code.qtpl:37
qs422016 := string(qb422016.B)
//line template/code.qtpl:37
qt422016.ReleaseByteBuffer(qb422016)
//line template/code.qtpl:37
return qs422016
//line template/code.qtpl:37
}
|