~emersion/gyosu

a0632ccc8a732511be40505afd5993f096841a29 — Simon Ser 9 days ago 872488f
template/unit: add table of contents
2 files changed, 18 insertions(+), 1 deletions(-)

M template/head.html
M template/unit.html
M template/head.html => template/head.html +3 -0
@@ 44,6 44,9 @@
			h3:hover a {
				visibility: visible;
			}
			details summary {
				cursor: pointer;
			}
		</style>
	</head>
	<body>

M template/unit.html => template/unit.html +15 -1
@@ 3,7 3,21 @@
<main>
	<h2>{{ .Title }}</h2>

	<a href="{{ .IndexHref }}">Back to index</a>
	<p>
		<a href="{{ .IndexHref }}">Back to index</a>
	</p>

	<details open>
		<summary>Table of contents</summary>

		<ul>
			{{ range .Decls }}
				<li>
					<a href="#{{ .Kind }}-{{ .Name }}">{{ .Title }}</a>
				</li>
			{{ end }}
		<ul>
	</details>

	{{ range .Decls }}
	<section class="{{ .Kind }}">