From 662ba2669f04448d21c3c0d28d9f21d5d6996583 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Wed, 11 Oct 2023 20:33:21 +0600 Subject: [PATCH] :bento: Generated templates and locales --- go.mod | 14 +- go.sum | 31 ++- locales/en/out.gotext.json | 40 ++++ locales/ru/messages.gotext.json | 30 +++ locales/ru/out.gotext.json | 30 +++ locales_gen.go | 64 ++++++ web/template/baseof.qtpl.go | 388 ++++++++++++++++++++++++++++++++ web/template/editor.qtpl.go | 218 ++++++++++++++++++ 8 files changed, 808 insertions(+), 7 deletions(-) create mode 100644 locales/en/out.gotext.json create mode 100644 locales/ru/messages.gotext.json create mode 100644 locales/ru/out.gotext.json create mode 100644 locales_gen.go create mode 100644 web/template/baseof.qtpl.go create mode 100644 web/template/editor.qtpl.go diff --git a/go.mod b/go.mod index ea178cd..7dfb6b4 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,18 @@ module source.toby3d.me/toby3d/pub go 1.21 require ( - github.com/google/go-cmp v0.5.9 + github.com/google/go-cmp v0.6.0 golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 ) -require golang.org/x/net v0.15.0 +require golang.org/x/net v0.17.0 -require github.com/caarlos0/env/v9 v9.0.0 +require ( + github.com/caarlos0/env/v9 v9.0.0 + github.com/valyala/quicktemplate v1.7.0 +) + +require ( + github.com/valyala/bytebufferpool v1.0.0 // indirect + golang.org/x/text v0.13.0 +) diff --git a/go.sum b/go.sum index df1ce12..9e080e2 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,31 @@ +github.com/andybalholm/brotli v1.0.2/go.mod h1:loMXtMfwqflxFJPmdbJO0a3KNoPuLBgiu3qAvBg8x/Y= +github.com/andybalholm/brotli v1.0.3/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig= github.com/caarlos0/env/v9 v9.0.0 h1:SI6JNsOA+y5gj9njpgybykATIylrRMklbs5ch6wO6pc= github.com/caarlos0/env/v9 v9.0.0/go.mod h1:ye5mlCVMYh6tZ+vCgrs/B95sj88cg5Tlnc0XIzgZ020= -github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= -github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/net v0.15.0 h1:ugBLEUaxABaB5AJqW9enI0ACdci2RUd4eP51NTBvuJ8= -golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/klauspost/compress v1.13.4/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.5/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47etQ6QUkpK6sk= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasthttp v1.30.0/go.mod h1:2rsYD01CKFrjjsvFxx75KlEUNpWNBY9JWD3K/7o2Cus= +github.com/valyala/quicktemplate v1.7.0 h1:LUPTJmlVcb46OOUY3IeD9DojFpAVbsG+5WFTcjMJzCM= +github.com/valyala/quicktemplate v1.7.0/go.mod h1:sqKJnoaOF88V07vkO+9FL8fb9uZg/VPSJnLYn+LmLk8= +github.com/valyala/tcplisten v1.0.0/go.mod h1:T0xQ8SeCZGxckz9qRXTfG43PvQ/mcWh7FwZEA7Ioqkc= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210510120150-4163338589ed/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= +golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= +golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 h1:H2TDz8ibqkAF6YGhCdN3jS9O0/s90v0rJh3X/OLHEUk= golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= diff --git a/locales/en/out.gotext.json b/locales/en/out.gotext.json new file mode 100644 index 0000000..6ac1173 --- /dev/null +++ b/locales/en/out.gotext.json @@ -0,0 +1,40 @@ +{ + "language": "en", + "messages": [ + { + "id": "Name", + "message": "Name", + "translation": "Name", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Content", + "message": "Content", + "translation": "Content", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Published at", + "message": "Published at", + "translation": "Published at", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Tags", + "message": "Tags", + "translation": "Tags", + "translatorComment": "Copied from source.", + "fuzzy": true + }, + { + "id": "Send", + "message": "Send", + "translation": "Send", + "translatorComment": "Copied from source.", + "fuzzy": true + } + ] +} \ No newline at end of file diff --git a/locales/ru/messages.gotext.json b/locales/ru/messages.gotext.json new file mode 100644 index 0000000..192edf3 --- /dev/null +++ b/locales/ru/messages.gotext.json @@ -0,0 +1,30 @@ +{ + "language": "ru", + "messages": [ + { + "id": "Name", + "message": "Name", + "translation": "Название" + }, + { + "id": "Content", + "message": "Content", + "translation": "Содержимое" + }, + { + "id": "Published at", + "message": "Published at", + "translation": "Дата публикации" + }, + { + "id": "Tags", + "message": "Tags", + "translation": "Тэги" + }, + { + "id": "Send", + "message": "Send", + "translation": "Отправить" + } + ] +} diff --git a/locales/ru/out.gotext.json b/locales/ru/out.gotext.json new file mode 100644 index 0000000..81b1e64 --- /dev/null +++ b/locales/ru/out.gotext.json @@ -0,0 +1,30 @@ +{ + "language": "ru", + "messages": [ + { + "id": "Name", + "message": "Name", + "translation": "Название" + }, + { + "id": "Content", + "message": "Content", + "translation": "Содержимое" + }, + { + "id": "Published at", + "message": "Published at", + "translation": "Дата публикации" + }, + { + "id": "Tags", + "message": "Tags", + "translation": "Тэги" + }, + { + "id": "Send", + "message": "Send", + "translation": "Отправить" + } + ] +} \ No newline at end of file diff --git a/locales_gen.go b/locales_gen.go new file mode 100644 index 0000000..8dd7d84 --- /dev/null +++ b/locales_gen.go @@ -0,0 +1,64 @@ +// Code generated by running "go generate" in golang.org/x/text. DO NOT EDIT. + +package main + +import ( + "golang.org/x/text/language" + "golang.org/x/text/message" + "golang.org/x/text/message/catalog" +) + +type dictionary struct { + index []uint32 + data string +} + +func (d *dictionary) Lookup(key string) (data string, ok bool) { + p, ok := messageKeyToIndex[key] + if !ok { + return "", false + } + start, end := d.index[p], d.index[p+1] + if start == end { + return "", false + } + return d.data[start:end], true +} + +func init() { + dict := map[string]catalog.Dictionary{ + "en": &dictionary{index: enIndex, data: enData}, + "ru": &dictionary{index: ruIndex, data: ruData}, + } + fallback := language.MustParse("en") + cat, err := catalog.NewFromMap(dict, catalog.Fallback(fallback)) + if err != nil { + panic(err) + } + message.DefaultCatalog = cat +} + +var messageKeyToIndex = map[string]int{ + "Content": 1, + "Name": 0, + "Published at": 2, + "Send": 4, + "Tags": 3, +} + +var enIndex = []uint32{ // 6 elements + 0x00000000, 0x00000005, 0x0000000d, 0x0000001a, + 0x0000001f, 0x00000024, +} // Size: 48 bytes + +const enData string = "\x02Name\x02Content\x02Published at\x02Tags\x02Send" + +var ruIndex = []uint32{ // 6 elements + 0x00000000, 0x00000011, 0x00000026, 0x00000044, + 0x0000004d, 0x00000060, +} // Size: 48 bytes + +const ruData string = "" + // Size: 96 bytes + "\x02Название\x02Содержимое\x02Дата публикации\x02Тэги\x02Отправить" + + // Total table size 228 bytes (0KiB); checksum: 36937515 diff --git a/web/template/baseof.qtpl.go b/web/template/baseof.qtpl.go new file mode 100644 index 0000000..275eb49 --- /dev/null +++ b/web/template/baseof.qtpl.go @@ -0,0 +1,388 @@ +// Code generated by qtc from "baseof.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +//line web/template/baseof.qtpl:1 +package template + +//line web/template/baseof.qtpl:1 +import ( + "golang.org/x/text/language" + "golang.org/x/text/message" +) + +//line web/template/baseof.qtpl:6 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line web/template/baseof.qtpl:6 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line web/template/baseof.qtpl:6 +type Page interface { +//line web/template/baseof.qtpl:6 + body() string +//line web/template/baseof.qtpl:6 + streambody(qw422016 *qt422016.Writer) +//line web/template/baseof.qtpl:6 + writebody(qq422016 qtio422016.Writer) +//line web/template/baseof.qtpl:6 + dir() string +//line web/template/baseof.qtpl:6 + streamdir(qw422016 *qt422016.Writer) +//line web/template/baseof.qtpl:6 + writedir(qq422016 qtio422016.Writer) +//line web/template/baseof.qtpl:6 + head() string +//line web/template/baseof.qtpl:6 + streamhead(qw422016 *qt422016.Writer) +//line web/template/baseof.qtpl:6 + writehead(qq422016 qtio422016.Writer) +//line web/template/baseof.qtpl:6 + lang() string +//line web/template/baseof.qtpl:6 + streamlang(qw422016 *qt422016.Writer) +//line web/template/baseof.qtpl:6 + writelang(qq422016 qtio422016.Writer) +//line web/template/baseof.qtpl:6 + title() string +//line web/template/baseof.qtpl:6 + streamtitle(qw422016 *qt422016.Writer) +//line web/template/baseof.qtpl:6 + writetitle(qq422016 qtio422016.Writer) +//line web/template/baseof.qtpl:6 + t(format message.Reference, a ...any) string +//line web/template/baseof.qtpl:6 + streamt(qw422016 *qt422016.Writer, format message.Reference, a ...any) +//line web/template/baseof.qtpl:6 + writet(qq422016 qtio422016.Writer, format message.Reference, a ...any) +//line web/template/baseof.qtpl:6 +} + +//line web/template/baseof.qtpl:16 +type BaseOf struct { + language language.Tag + printer *message.Printer +} + +func NewBaseOf(lang language.Tag) *BaseOf { + return &BaseOf{ + language: lang, + printer: message.NewPrinter(lang), + } +} + +//line web/template/baseof.qtpl:29 +func (b *BaseOf) streamlang(qw422016 *qt422016.Writer) { +//line web/template/baseof.qtpl:29 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:30 + qw422016.E().S(b.language.String()) +//line web/template/baseof.qtpl:30 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:31 +} + +//line web/template/baseof.qtpl:31 +func (b *BaseOf) writelang(qq422016 qtio422016.Writer) { +//line web/template/baseof.qtpl:31 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:31 + b.streamlang(qw422016) +//line web/template/baseof.qtpl:31 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:31 +} + +//line web/template/baseof.qtpl:31 +func (b *BaseOf) lang() string { +//line web/template/baseof.qtpl:31 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:31 + b.writelang(qb422016) +//line web/template/baseof.qtpl:31 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:31 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:31 + return qs422016 +//line web/template/baseof.qtpl:31 +} + +//line web/template/baseof.qtpl:33 +func (b *BaseOf) streamdir(qw422016 *qt422016.Writer) { +//line web/template/baseof.qtpl:33 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:34 + for _, tag := range []language.Tag{ + language.Arabic, + language.Hebrew, + language.Persian, + language.Urdu, + } { +//line web/template/baseof.qtpl:39 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:40 + if b.language != tag { +//line web/template/baseof.qtpl:40 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:41 + continue +//line web/template/baseof.qtpl:42 + } +//line web/template/baseof.qtpl:42 + qw422016.N().S(` +rtl +`) +//line web/template/baseof.qtpl:44 + return +//line web/template/baseof.qtpl:45 + } +//line web/template/baseof.qtpl:45 + qw422016.N().S(` +ltr +`) +//line web/template/baseof.qtpl:47 +} + +//line web/template/baseof.qtpl:47 +func (b *BaseOf) writedir(qq422016 qtio422016.Writer) { +//line web/template/baseof.qtpl:47 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:47 + b.streamdir(qw422016) +//line web/template/baseof.qtpl:47 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:47 +} + +//line web/template/baseof.qtpl:47 +func (b *BaseOf) dir() string { +//line web/template/baseof.qtpl:47 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:47 + b.writedir(qb422016) +//line web/template/baseof.qtpl:47 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:47 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:47 + return qs422016 +//line web/template/baseof.qtpl:47 +} + +//line web/template/baseof.qtpl:49 +func (b *BaseOf) streamtitle(qw422016 *qt422016.Writer) { +//line web/template/baseof.qtpl:49 + qw422016.N().S(` +Micropub +`) +//line web/template/baseof.qtpl:51 +} + +//line web/template/baseof.qtpl:51 +func (b *BaseOf) writetitle(qq422016 qtio422016.Writer) { +//line web/template/baseof.qtpl:51 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:51 + b.streamtitle(qw422016) +//line web/template/baseof.qtpl:51 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:51 +} + +//line web/template/baseof.qtpl:51 +func (b *BaseOf) title() string { +//line web/template/baseof.qtpl:51 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:51 + b.writetitle(qb422016) +//line web/template/baseof.qtpl:51 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:51 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:51 + return qs422016 +//line web/template/baseof.qtpl:51 +} + +//line web/template/baseof.qtpl:53 +func (b *BaseOf) streamhead(qw422016 *qt422016.Writer) { +//line web/template/baseof.qtpl:53 +} + +//line web/template/baseof.qtpl:53 +func (b *BaseOf) writehead(qq422016 qtio422016.Writer) { +//line web/template/baseof.qtpl:53 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:53 + b.streamhead(qw422016) +//line web/template/baseof.qtpl:53 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:53 +} + +//line web/template/baseof.qtpl:53 +func (b *BaseOf) head() string { +//line web/template/baseof.qtpl:53 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:53 + b.writehead(qb422016) +//line web/template/baseof.qtpl:53 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:53 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:53 + return qs422016 +//line web/template/baseof.qtpl:53 +} + +//line web/template/baseof.qtpl:54 +func (b *BaseOf) streambody(qw422016 *qt422016.Writer) { +//line web/template/baseof.qtpl:54 +} + +//line web/template/baseof.qtpl:54 +func (b *BaseOf) writebody(qq422016 qtio422016.Writer) { +//line web/template/baseof.qtpl:54 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:54 + b.streambody(qw422016) +//line web/template/baseof.qtpl:54 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:54 +} + +//line web/template/baseof.qtpl:54 +func (b *BaseOf) body() string { +//line web/template/baseof.qtpl:54 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:54 + b.writebody(qb422016) +//line web/template/baseof.qtpl:54 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:54 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:54 + return qs422016 +//line web/template/baseof.qtpl:54 +} + +//line web/template/baseof.qtpl:56 +func (b *BaseOf) streamt(qw422016 *qt422016.Writer, format message.Reference, a ...any) { +//line web/template/baseof.qtpl:56 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:57 + qw422016.E().S(b.printer.Sprintf(format, a...)) +//line web/template/baseof.qtpl:57 + qw422016.N().S(` +`) +//line web/template/baseof.qtpl:58 +} + +//line web/template/baseof.qtpl:58 +func (b *BaseOf) writet(qq422016 qtio422016.Writer, format message.Reference, a ...any) { +//line web/template/baseof.qtpl:58 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:58 + b.streamt(qw422016, format, a...) +//line web/template/baseof.qtpl:58 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:58 +} + +//line web/template/baseof.qtpl:58 +func (b *BaseOf) t(format message.Reference, a ...any) string { +//line web/template/baseof.qtpl:58 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:58 + b.writet(qb422016, format, a...) +//line web/template/baseof.qtpl:58 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:58 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:58 + return qs422016 +//line web/template/baseof.qtpl:58 +} + +//line web/template/baseof.qtpl:60 +func StreamTemplate(qw422016 *qt422016.Writer, p Page) { +//line web/template/baseof.qtpl:60 + qw422016.N().S(` + + + + + + + `) +//line web/template/baseof.qtpl:69 + p.streamhead(qw422016) +//line web/template/baseof.qtpl:69 + qw422016.N().S(` + `) +//line web/template/baseof.qtpl:70 + p.streamtitle(qw422016) +//line web/template/baseof.qtpl:70 + qw422016.N().S(` + + + + `) +//line web/template/baseof.qtpl:74 + p.streambody(qw422016) +//line web/template/baseof.qtpl:74 + qw422016.N().S(` + + +`) +//line web/template/baseof.qtpl:77 +} + +//line web/template/baseof.qtpl:77 +func WriteTemplate(qq422016 qtio422016.Writer, p Page) { +//line web/template/baseof.qtpl:77 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/baseof.qtpl:77 + StreamTemplate(qw422016, p) +//line web/template/baseof.qtpl:77 + qt422016.ReleaseWriter(qw422016) +//line web/template/baseof.qtpl:77 +} + +//line web/template/baseof.qtpl:77 +func Template(p Page) string { +//line web/template/baseof.qtpl:77 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/baseof.qtpl:77 + WriteTemplate(qb422016, p) +//line web/template/baseof.qtpl:77 + qs422016 := string(qb422016.B) +//line web/template/baseof.qtpl:77 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/baseof.qtpl:77 + return qs422016 +//line web/template/baseof.qtpl:77 +} diff --git a/web/template/editor.qtpl.go b/web/template/editor.qtpl.go new file mode 100644 index 0000000..4ccb472 --- /dev/null +++ b/web/template/editor.qtpl.go @@ -0,0 +1,218 @@ +// Code generated by qtc from "editor.qtpl". DO NOT EDIT. +// See https://github.com/valyala/quicktemplate for details. + +//line web/template/editor.qtpl:1 +package template + +//line web/template/editor.qtpl:1 +import ( + "time" +) + +//line web/template/editor.qtpl:5 +import ( + qtio422016 "io" + + qt422016 "github.com/valyala/quicktemplate" +) + +//line web/template/editor.qtpl:5 +var ( + _ = qtio422016.Copy + _ = qt422016.AcquireByteBuffer +) + +//line web/template/editor.qtpl:6 +type PageEditor struct { + *BaseOf + now time.Time +} + +func NewPageEditor(base *BaseOf) *PageEditor { + return &PageEditor{ + BaseOf: base, + now: time.Now().UTC(), + } +} + +//line web/template/editor.qtpl:19 +func (pe *PageEditor) streamtitle(qw422016 *qt422016.Writer) { +//line web/template/editor.qtpl:19 + qw422016.N().S(` +Editor — Micropub +`) +//line web/template/editor.qtpl:21 +} + +//line web/template/editor.qtpl:21 +func (pe *PageEditor) writetitle(qq422016 qtio422016.Writer) { +//line web/template/editor.qtpl:21 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/editor.qtpl:21 + pe.streamtitle(qw422016) +//line web/template/editor.qtpl:21 + qt422016.ReleaseWriter(qw422016) +//line web/template/editor.qtpl:21 +} + +//line web/template/editor.qtpl:21 +func (pe *PageEditor) title() string { +//line web/template/editor.qtpl:21 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/editor.qtpl:21 + pe.writetitle(qb422016) +//line web/template/editor.qtpl:21 + qs422016 := string(qb422016.B) +//line web/template/editor.qtpl:21 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/editor.qtpl:21 + return qs422016 +//line web/template/editor.qtpl:21 +} + +//line web/template/editor.qtpl:23 +func (pe *PageEditor) streamhead(qw422016 *qt422016.Writer) { +//line web/template/editor.qtpl:23 +} + +//line web/template/editor.qtpl:23 +func (pe *PageEditor) writehead(qq422016 qtio422016.Writer) { +//line web/template/editor.qtpl:23 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/editor.qtpl:23 + pe.streamhead(qw422016) +//line web/template/editor.qtpl:23 + qt422016.ReleaseWriter(qw422016) +//line web/template/editor.qtpl:23 +} + +//line web/template/editor.qtpl:23 +func (pe *PageEditor) head() string { +//line web/template/editor.qtpl:23 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/editor.qtpl:23 + pe.writehead(qb422016) +//line web/template/editor.qtpl:23 + qs422016 := string(qb422016.B) +//line web/template/editor.qtpl:23 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/editor.qtpl:23 + return qs422016 +//line web/template/editor.qtpl:23 +} + +//line web/template/editor.qtpl:25 +func (pe *PageEditor) streambody(qw422016 *qt422016.Writer) { +//line web/template/editor.qtpl:25 + qw422016.N().S(` +
+ + + +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+ +
+
+`) +//line web/template/editor.qtpl:84 +} + +//line web/template/editor.qtpl:84 +func (pe *PageEditor) writebody(qq422016 qtio422016.Writer) { +//line web/template/editor.qtpl:84 + qw422016 := qt422016.AcquireWriter(qq422016) +//line web/template/editor.qtpl:84 + pe.streambody(qw422016) +//line web/template/editor.qtpl:84 + qt422016.ReleaseWriter(qw422016) +//line web/template/editor.qtpl:84 +} + +//line web/template/editor.qtpl:84 +func (pe *PageEditor) body() string { +//line web/template/editor.qtpl:84 + qb422016 := qt422016.AcquireByteBuffer() +//line web/template/editor.qtpl:84 + pe.writebody(qb422016) +//line web/template/editor.qtpl:84 + qs422016 := string(qb422016.B) +//line web/template/editor.qtpl:84 + qt422016.ReleaseByteBuffer(qb422016) +//line web/template/editor.qtpl:84 + return qs422016 +//line web/template/editor.qtpl:84 +}