From 4aa7728283f4e0ece89437bf7933e8293063c830 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 8 Jan 2020 01:58:44 +0000 Subject: Use mandoc -T html for about-filter This also makes source-filter show mdoc source again and removes the dependency on ttpre entirely. I copied in the inline stylesheet mandoc outputs without -O fragment and added some customizations. --- www/git.causal.agency/.gitignore | 1 - www/git.causal.agency/Makefile | 8 ++------ www/git.causal.agency/about-filter.sh | 6 +----- www/git.causal.agency/custom.css | 29 +++++++++++++++++++++++++---- www/git.causal.agency/source-filter.sh | 11 +---------- 5 files changed, 29 insertions(+), 26 deletions(-) diff --git a/www/git.causal.agency/.gitignore b/www/git.causal.agency/.gitignore index d53ebc26..8d20f25d 100644 --- a/www/git.causal.agency/.gitignore +++ b/www/git.causal.agency/.gitignore @@ -1,4 +1,3 @@ about-filter hi source-filter -ttpre diff --git a/www/git.causal.agency/Makefile b/www/git.causal.agency/Makefile index 8b87920f..28e08ba5 100644 --- a/www/git.causal.agency/Makefile +++ b/www/git.causal.agency/Makefile @@ -3,20 +3,16 @@ WWW = /usr/local/www/cgit LIBEXEC = /usr/local/libexec BIN = ../../bin -BINS = about-filter source-filter ttpre hi +BINS = about-filter source-filter hi install: cgitrc custom.css ${BINS} install -m 644 cgitrc ${ETC} install -m 644 custom.css ${WWW} install ${BINS} ${LIBEXEC} -ttpre hi: +hi: ${BIN}/hi.c ${MAKE} -C ${BIN} $@ cp ${BIN}/$@ $@ -ttpre: ${BIN}/ttpre.c - -hi: ${BIN}/hi.c - clean: rm -f ${BINS} diff --git a/www/git.causal.agency/about-filter.sh b/www/git.causal.agency/about-filter.sh index 26a52648..c7161006 100644 --- a/www/git.causal.agency/about-filter.sh +++ b/www/git.causal.agency/about-filter.sh @@ -1,12 +1,8 @@ #!/bin/sh -export LANG=en_US.UTF-8 case "$1" in (*.[1-9]) - /usr/bin/mandoc \ - | /usr/local/libexec/ttpre \ - | /usr/bin/sed -E \ - 's,([a-z0-9_-]+)[(]([1-9])[)],&,g' + /usr/bin/mandoc -T html -O fragment,man=%N.%S,includes=../tree/%I ;; (*) exec /usr/local/libexec/hi -l text -f html diff --git a/www/git.causal.agency/custom.css b/www/git.causal.agency/custom.css index 9d7b3a0b..921cf09e 100644 --- a/www/git.causal.agency/custom.css +++ b/www/git.causal.agency/custom.css @@ -39,16 +39,17 @@ div#cgit table.list tr.nohover-highlight:hover:nth-child(even) { background: inherit; } -div#cgit table.blob td.linenumbers:nth-last-child(3) { - display: none; -} - div#cgit table.blob td.linenumbers a:target { color: goldenrod; text-decoration: underline; outline: none; } +div#cgit div#summary { + max-width: 80ch; +} + +/* from hi(1) */ div#cgit .hi.Keyword { color: dimgray; } div#cgit .hi.Macro { color: green; } div#cgit .hi.Tag { color: inherit; text-decoration: underline; } @@ -60,3 +61,23 @@ div#cgit .hi.Todo { color: navy; font-weight: bold; } div#cgit .hi.DiffOld { color: red; } div#cgit .hi.DiffNew { color: green; } div#cgit .hi.Tag:target { color: goldenrod; outline: none; } + +/* from mandoc(1) */ +table.head, table.foot { width: 100%; } +td.head-rtitle, td.foot-os { text-align: right; } +td.head-vol { text-align: center; } +div.Pp { margin: 1ex 0ex; } +div.Nd, div.Bf, div.Op { display: inline; } +span.Pa, span.Ad { font-style: italic; } +span.Ms { font-weight: bold; } +dl.Bl-diag > dt { font-weight: bold; } +code.Nm, code.Fl, code.Cm, code.Ic, code.In, code.Fd, code.Fn, +code.Cd { font-weight: bold; font-family: inherit; } + +table.Nm td:first-child { padding-right: 1ch; } +code.Fl { white-space: nowrap; } +dl.Bl-tag dt { margin-top: 1em; } +div.Bd-indent { margin-left: 4ch; } +table.foot { margin-top: 1em; } + +div#cgit a.permalink { color: inherit; } diff --git a/www/git.causal.agency/source-filter.sh b/www/git.causal.agency/source-filter.sh index 5c5eb734..4febc2e0 100644 --- a/www/git.causal.agency/source-filter.sh +++ b/www/git.causal.agency/source-filter.sh @@ -1,12 +1,3 @@ #!/bin/sh -export LANG=en_US.UTF-8 -case "$1" in - (*.[1-9]) - /usr/local/libexec/about-filter "$@" - printf '
'
-		;;
-	(*)
-		exec /usr/local/libexec/hi -t -n "$1" -f html -o anchor
-		;;
-esac
+exec /usr/local/libexec/hi -t -n "$1" -f html -o anchor
-- 
cgit 1.4.1

of a hack. hilex still lacks
a shell lexer, but hi's was never very good anyway.



2021-01-13Add gg mapping to viJune McEnroe

The muscle memory for gg is too strong.



2021-01-13Match \ before newline in string as EscapeJune McEnroe


2021-01-13Remove -t flag from ctags commandsJune McEnroe

It's the default/only there for compatibility on the implementations I use.



2021-01-13Match strftime format specifiersJune McEnroe


2021-01-13Switch git.causal.agency to hilex and htagmlJune McEnroe

Still missing a shell lexer in hilex, but well... it's shell.



2021-01-13Try to return make substitutions as single tokensJune McEnroe


2021-01-13Shorten hilex class namesJune McEnroe


2021-01-13Move text "lexer" to hilex.cJune McEnroe


2021-01-13Try to return strings as single tokensJune McEnroe


2021-01-13Match [] as Operator in C lexerJune McEnroe


2021-01-13Fix C lexer to require a digit in a float literalJune McEnroe

Otherwise ".l" is matched as Number.



2021-01-13Support long double in c.shJune McEnroe


2021-01-13Update Terminal.app coloursJune McEnroe

God what is this garbage I only changed one colour.



2021-01-13Increase dark white brightness slightlyJune McEnroe


2021-01-13Add hilex example to htagml manualJune McEnroe


2021-01-12Style causal.agency like bin HTMLJune McEnroe


2021-01-12Avoid matching tag text inside HTML elementsJune McEnroe


2021-01-12Use hilex for up -hJune McEnroe


2021-01-12Use hilex for bin HTMLJune McEnroe


2021-01-12Don't output a pre in hilex by defaultJune McEnroe


2021-01-12Move hilex out of hilex directoryJune McEnroe


2021-01-12Consolidate hilex formatters into hilex.cJune McEnroe


2021-01-12Remove hacky tagging from hilexJune McEnroe

God that makes the lexers so much simpler.



2021-01-12Add htagml -iJune McEnroe


2021-01-12Render tag index in HTMLJune McEnroe


2021-01-12Add htagml -xJune McEnroe


2021-01-12Prevent matching the same tag twiceJune McEnroe


2021-01-12Process htagml file line by lineJune McEnroe

This simplifies some things, adds support for line number tag
definitions, and should enable combining htagml with other preprocessors
in the future.



2021-01-12Split fields by tab onlyJune McEnroe

Also don't fail hard on non-forward-search definitions.



2021-01-12List both Makefile and html.sh under README.7June McEnroe


2021-01-12Add htagml exampleJune McEnroe


2021-01-12Use mandoc and htagml for bin htmlJune McEnroe


2021-01-12Add htagmlJune McEnroe


2021-01-12Replace causal.agency with a simple mdoc pageJune McEnroe


2021-01-11Publish "Using vi"June McEnroe


2021-01-11Enable diff.colorMovedJune McEnroe


2021-01-10Set less search case-insensitiveJune McEnroe


2021-01-10Set EXINITJune McEnroe

neovim is laggy as hell in my OpenBSD VM, so I switched to vi so I
could type without getting frustrated.



2021-01-09Add c -t flag to print expression typeJune McEnroe

Also add missing float case.



2021-01-05Update taglineJune McEnroe