diff options
Diffstat (limited to 'template/code.qtpl.go')
| -rw-r--r-- | template/code.qtpl.go | 207 |
1 files changed, 207 insertions, 0 deletions
diff --git a/template/code.qtpl.go b/template/code.qtpl.go new file mode 100644 index 0000000..2fa1401 --- /dev/null +++ b/template/code.qtpl.go @@ -0,0 +1,207 @@ +// 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_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 contents. + +//line template/code.qtpl:26 +func streamcode_contents(qw422016 *qt422016.Writer, lang, data string) { +//line template/code.qtpl:26 + qw422016.N().S(` + <pre><code class='language-`) +//line template/code.qtpl:27 + qw422016.E().S(lang) +//line template/code.qtpl:27 + qw422016.N().S(`'>`) +//line template/code.qtpl:27 + qw422016.E().S(data) +//line template/code.qtpl:27 + qw422016.N().S(`</code></pre> +`) +//line template/code.qtpl:28 +} + +//line template/code.qtpl:28 +func writecode_contents(qq422016 qtio422016.Writer, lang, data string) { +//line template/code.qtpl:28 + qw422016 := qt422016.AcquireWriter(qq422016) +//line template/code.qtpl:28 + streamcode_contents(qw422016, lang, data) +//line template/code.qtpl:28 + qt422016.ReleaseWriter(qw422016) +//line template/code.qtpl:28 +} + +//line template/code.qtpl:28 +func code_contents(lang, data string) string { +//line template/code.qtpl:28 + qb422016 := qt422016.AcquireByteBuffer() +//line template/code.qtpl:28 + writecode_contents(qb422016, lang, data) +//line template/code.qtpl:28 + qs422016 := string(qb422016.B) +//line template/code.qtpl:28 + qt422016.ReleaseByteBuffer(qb422016) +//line template/code.qtpl:28 + return qs422016 +//line template/code.qtpl:28 +} |
