mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-13 22:00:27 +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.
33 lines
955 B
Plaintext
33 lines
955 B
Plaintext
{% import "sort" %}
|
|
{% import "path" %}
|
|
{% 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 ║║
|
|
║╚════════════╝║
|
|
╚══════════════╝
|
|
{% func childHTML(c *child) %}
|
|
{% code
|
|
sort.Slice(c.children, func(i, j int) bool {
|
|
return c.children[i].name < c.children[j].name
|
|
})
|
|
%}
|
|
<li class="subhyphae__entry">
|
|
<a class="subhyphae__link {% if !c.exists %}wikilink_new{% endif %}" href="/hypha/{%s c.name %}">
|
|
{%s util.BeautifulName(path.Base(c.name)) %}
|
|
</a>
|
|
{% if len(c.children) > 0 %}
|
|
<ul>
|
|
{% for _, child := range c.children %}
|
|
{%s= childHTML(&child) %}
|
|
{% endfor %}
|
|
</ul>
|
|
{% endif %}
|
|
</li>
|
|
{% endfunc %}
|
|
|