htmlroc/template.html

63 lines
1.8 KiB
HTML
Raw Normal View History

2019-06-13 21:04:49 +00:00
<!DOCTYPE html>
<html>
<head>
<title>{{ .Title }}</title>
2019-06-14 13:21:11 +00:00
<link rel="stylesheet" href="static/style.min.css">
<script src="static/script.min.js" defer></script>
2019-06-13 21:04:49 +00:00
</head>
<body>
2019-06-14 13:21:11 +00:00
<nav class="topbar"></nav>
2019-06-13 22:03:45 +00:00
<main>
<header class="credits">
{{ .Credits | toCredits }}
</header>
2019-06-14 13:21:11 +00:00
<section class="toc">
<h2>Table of contents</h2>
<ul>
{{ range .Sections }}
<li>
<a href="#{{ .ID }}">{{ .ID }}. {{ .Title }}</a>
<ul>
{{ range .Rules }}
{{ if (eq .Depth 0) }}
<li>
<a href="#{{ .ID }}">{{ .ID }}. {{ .Text | firstLine }}</a>
</li>
{{ end }}
{{ end }}
</ul>
</li>
{{ end }}
</ul>
</section>
2019-06-13 22:03:45 +00:00
<section class="rules">
{{ range .Sections }}
<h2 id="{{ .ID }}">{{ .ID }}. {{ .Title }}</h2>
{{ if .Extra }}
2019-06-14 09:37:08 +00:00
{{ if (eq .Title "Glossary")}}
<dl class="glossary">
{{ range (toGlossary .Text) }}
<dt>{{ .Keyword }}</dt>
<dd>{{ .Definition }}</dd>
{{ end }}
</dl>
{{ else }}
2019-06-14 13:21:11 +00:00
<p>{{ .Text | htmlify }}</p>
2019-06-14 09:37:08 +00:00
{{ end }}
2019-06-13 22:03:45 +00:00
{{ else }}
<ul>
{{ range .Rules }}
2019-06-14 13:21:11 +00:00
<li id="{{ .ID }}" class="depth-{{ .Depth }}">
<p>({{ .ID }}) {{ .Text | htmlify }}</p>
</li>
2019-06-13 22:03:45 +00:00
{{ end }}
</ul>
{{ end }}
{{ end }}
</section>
</main>
2019-06-13 21:04:49 +00:00
</body>
</html>