From b031db98f37320bd3e4d734da8ec3a3388ae3cc4 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 12 Sep 2024 10:48:10 +0200 Subject: [PATCH] Publish man pages as HTML They are still not linked in the index page. --- .build.yml | 22 +++++++++++++- man2html.sh | 5 ++++ site/man/man-style.css | 66 ++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 man2html.sh create mode 100644 site/man/man-style.css diff --git a/.build.yml b/.build.yml index 13ab07a..5d42abb 100644 --- a/.build.yml +++ b/.build.yml @@ -1,13 +1,33 @@ -image: archlinux +image: alpine/edge oauth: pages.sr.ht/PAGES:RW sources: - https://github.com/swaywm/swaywm.org packages: - hut + - mandoc + - sway-doc tasks: - build: | cd swaywm.org/ curl -o site/intro.webm https://l.sr.ht/lJ9C.webm + - man: | + man2html() { + # $1: section + # $2: name + gunzip -c /usr/share/man/man$1/$2.$1.gz | mandoc -T html -O style=man-style.css > $2.$1.html + } + mkdir swaywm.org/site/man/ + cd swaywm.org/site/man/ + man2html 1 sway + man2html 1 swaymsg + man2html 1 swaynag + man2html 5 sway-bar + man2html 5 sway-input + man2html 5 sway-output + man2html 5 sway + man2html 5 swaynag + man2html 7 sway-ipc + man2html 7 swaybar-protocol - deploy: | [ -n "$GITHUB_PR_NUMBER" ] && complete-build tar -cvz -C swaywm.org/site/ . | hut pages publish -d swaywm.org diff --git a/man2html.sh b/man2html.sh new file mode 100644 index 0000000..97427b0 --- /dev/null +++ b/man2html.sh @@ -0,0 +1,5 @@ +#!/bin/sh +# $1: section +# $2 name + +gunzip -c /usr/share/man/man$section/$name.$section.gz | mandoc -T html -O style=man-style.css > $name.$section.html diff --git a/site/man/man-style.css b/site/man/man-style.css new file mode 100644 index 0000000..593c067 --- /dev/null +++ b/site/man/man-style.css @@ -0,0 +1,66 @@ +/* From: https://git.sr.ht/~emersion/soju/tree/website */ + +body { + max-width: 88ex; + padding: 2ex 4ex; + + font-family: monospace; + font-size: 14px; +} + +.head, +.foot { + width: 100%; + color: #999; +} + +.foot { + margin-top: 3ex; +} + +.head-vol { + text-align: center; +} + +.head-rtitle { + text-align: right; +} + +h1 { + font-size: 16px; +} + +h2 { + font-size: 14px; +} + +p { + text-align: justify; +} +.Bd-indent { + padding-left: 4ex; +} + +pre { + color: #434241; +} + +@media (prefers-color-scheme: dark) { + body { + background-color: #18191a; + color: #ffffff; + } + + .head, + .foot { + color: #cac0b3; + } + + a { + color: #3daeff; + } + + pre { + color: #e4ded3; + } +}