mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-10-30 03:36:16 +00:00
ac4c4d665c
Because of that, I could reimplement the rest of the package tree more straight-forward. Also deleted the package iteration because it is no longer used anywhere.
127 lines
2.8 KiB
Go
127 lines
2.8 KiB
Go
// Code generated by qtc from "view.qtpl". DO NOT EDIT.
|
|
// See https://github.com/valyala/quicktemplate for details.
|
|
|
|
//line tree/view.qtpl:1
|
|
package tree
|
|
|
|
//line tree/view.qtpl:1
|
|
import "sort"
|
|
|
|
//line tree/view.qtpl:2
|
|
import "path"
|
|
|
|
//line tree/view.qtpl:3
|
|
import "github.com/bouncepaw/mycorrhiza/util"
|
|
|
|
// Subhyphae links are recursive. It may end up looking like that if drawn with
|
|
// pseudographics:
|
|
// ╔══════════════╗
|
|
// ║Foo ║ The presented hyphae are ./foo and ./foo/bar
|
|
// ║╔════════════╗║
|
|
// ║║Bar ║║
|
|
// ║╚════════════╝║
|
|
// ╚══════════════╝
|
|
|
|
//line tree/view.qtpl:13
|
|
import (
|
|
qtio422016 "io"
|
|
|
|
qt422016 "github.com/valyala/quicktemplate"
|
|
)
|
|
|
|
//line tree/view.qtpl:13
|
|
var (
|
|
_ = qtio422016.Copy
|
|
_ = qt422016.AcquireByteBuffer
|
|
)
|
|
|
|
//line tree/view.qtpl:13
|
|
func streamchildHTML(qw422016 *qt422016.Writer, c *child) {
|
|
//line tree/view.qtpl:13
|
|
qw422016.N().S(`
|
|
`)
|
|
//line tree/view.qtpl:15
|
|
sort.Slice(c.children, func(i, j int) bool {
|
|
return c.children[i].name < c.children[j].name
|
|
})
|
|
|
|
//line tree/view.qtpl:18
|
|
qw422016.N().S(`
|
|
<li class="subhyphae__entry">
|
|
<a class="subhyphae__link `)
|
|
//line tree/view.qtpl:20
|
|
if !c.exists {
|
|
//line tree/view.qtpl:20
|
|
qw422016.N().S(`wikilink_new`)
|
|
//line tree/view.qtpl:20
|
|
}
|
|
//line tree/view.qtpl:20
|
|
qw422016.N().S(`" href="/hypha/`)
|
|
//line tree/view.qtpl:20
|
|
qw422016.E().S(c.name)
|
|
//line tree/view.qtpl:20
|
|
qw422016.N().S(`">
|
|
`)
|
|
//line tree/view.qtpl:21
|
|
qw422016.E().S(util.BeautifulName(path.Base(c.name)))
|
|
//line tree/view.qtpl:21
|
|
qw422016.N().S(`
|
|
</a>
|
|
`)
|
|
//line tree/view.qtpl:23
|
|
if len(c.children) > 0 {
|
|
//line tree/view.qtpl:23
|
|
qw422016.N().S(`
|
|
<ul>
|
|
`)
|
|
//line tree/view.qtpl:25
|
|
for _, child := range c.children {
|
|
//line tree/view.qtpl:25
|
|
qw422016.N().S(`
|
|
`)
|
|
//line tree/view.qtpl:26
|
|
qw422016.N().S(childHTML(&child))
|
|
//line tree/view.qtpl:26
|
|
qw422016.N().S(`
|
|
`)
|
|
//line tree/view.qtpl:27
|
|
}
|
|
//line tree/view.qtpl:27
|
|
qw422016.N().S(`
|
|
</ul>
|
|
`)
|
|
//line tree/view.qtpl:29
|
|
}
|
|
//line tree/view.qtpl:29
|
|
qw422016.N().S(`
|
|
</li>
|
|
`)
|
|
//line tree/view.qtpl:31
|
|
}
|
|
|
|
//line tree/view.qtpl:31
|
|
func writechildHTML(qq422016 qtio422016.Writer, c *child) {
|
|
//line tree/view.qtpl:31
|
|
qw422016 := qt422016.AcquireWriter(qq422016)
|
|
//line tree/view.qtpl:31
|
|
streamchildHTML(qw422016, c)
|
|
//line tree/view.qtpl:31
|
|
qt422016.ReleaseWriter(qw422016)
|
|
//line tree/view.qtpl:31
|
|
}
|
|
|
|
//line tree/view.qtpl:31
|
|
func childHTML(c *child) string {
|
|
//line tree/view.qtpl:31
|
|
qb422016 := qt422016.AcquireByteBuffer()
|
|
//line tree/view.qtpl:31
|
|
writechildHTML(qb422016, c)
|
|
//line tree/view.qtpl:31
|
|
qs422016 := string(qb422016.B)
|
|
//line tree/view.qtpl:31
|
|
qt422016.ReleaseByteBuffer(qb422016)
|
|
//line tree/view.qtpl:31
|
|
return qs422016
|
|
//line tree/view.qtpl:31
|
|
}
|