From e50db1d199eb18a9d9e5ab02c3928989f4a7d81f Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Mon, 25 Dec 2023 03:23:44 +0100 Subject: Experimentally add a section for manual pages --- include/mkman | 39 ++++++++++++++++++ src/index.gsp | 1 + src/man/index.gsp | 39 ++++++++++++++++++ src/man/links | 13 ++++++ src/man/style.css | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/style.css | 8 ++-- 6 files changed, 212 insertions(+), 3 deletions(-) create mode 100755 include/mkman create mode 100644 src/man/index.gsp create mode 100644 src/man/links create mode 100644 src/man/style.css diff --git a/include/mkman b/include/mkman new file mode 100755 index 0000000..30250eb --- /dev/null +++ b/include/mkman @@ -0,0 +1,39 @@ +#!/usr/local/bin/andy + +func dl link { + set man `basename $link + set dst out/man/$man + + mkdir -p $dst + set name `echo $man | sed -E 's/(.*)\.(.)/\U\1(\2)/' + { + echo "header { div { h1 {-$name Manual Page}" + cat include/nav.gsp + echo "}} hr{}" + } | gsp -d | read head + curl -LSs $link + | mandoc -Thtml -Ostyle=/man/style.css + | awk -v head=$head ' + !/^/ + /^/ { print $0, head } + ' >!$dst/index.html + + printf 'li {a href="%s" {-%s — %s}}\n' ( + $man + `printf $name | tr A-Z a-z + `htmlq -t .Nd <$dst/index.html | tr -d \n | tr -s ' ' + ) +} + +cd `dirname $args[0] +cd .. + +if ! test -f src/man/links { + set argv0 `basename $args[0] + echo "$argv0: Links file does not exist" >/dev/stderr + exit 1 +} + +while read -d\n -n1 _ { + dl $_ +} div { + display: flex; + justify-content: space-between; + align-items: center; +} + +header > div menu { + display: flex; + gap: 2ch; +} + +header > div li { + list-style: none; +} + +hr { + margin-block: 4ch; +} + +h1 { + font-size: 1.8rem; + margin-bottom: 0; +} + +h2 { + font-size: 1.2em; +} + +a { + color: var(--accent); +} + +a:hover { + text-decoration: none; +} + +pre, code, kbd, samp { + font-family: var(--mono); + font-size: 0.9em; +} + +code { + white-space: nowrap; +} + +.head, .foot { + display: flex; + justify-content: space-between; +} + +.tbl { + width: 100%; + border-spacing: 0; + border-collapse: collapse; + border-width: 1px; +} + +.tbl :is(tr, td) { + border-width: 1px; +} + +.tbl + .tbl { + margin-block: 1em; +} + +.tbl td { + padding-inline: 8px; +} + +@media (min-width: 800px) { + body { + font-size: 1.3rem; + line-height: 1.5; + } +} diff --git a/src/style.css b/src/style.css index 70419ed..19a32ab 100644 --- a/src/style.css +++ b/src/style.css @@ -63,9 +63,11 @@ h2 { font-size: 1.2rem; } a { color: var(--accent); } a:hover { text-decoration: none; } -blockquote > p:first-child::before { content: '‘'; } -blockquote > p:last-child::after { content: '’'; } -blockquote + figcaption::before { content: '— '; } +blockquote > p:first-child::before { content: '‘'; } +blockquote > p:last-child::after { content: '’'; } +blockquote.de > p:first-child::before { content: '„'; } +blockquote.de > p:last-child::after { content: '“'; } +blockquote + figcaption::before { content: '— '; } blockquote, blockquote + figcaption { font-style: italic; } -- cgit v1.2.3