summary refs log tree commit diff
path: root/bin/html.sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-01-12 16:55:34 -0500
committerJune McEnroe <june@causal.agency>2021-01-12 16:55:34 -0500
commit4708b1750f705155c557cf9ca3f2b03967c47696 (patch)
tree9c963013342614b581f91c14c40e22cebeca41e3 /bin/html.sh
parentAdd htagml (diff)
downloadsrc-4708b1750f705155c557cf9ca3f2b03967c47696.tar.gz
src-4708b1750f705155c557cf9ca3f2b03967c47696.zip
Use mandoc and htagml for bin html
Diffstat (limited to 'bin/html.sh')
-rw-r--r--bin/html.sh65
1 files changed, 45 insertions, 20 deletions
diff --git a/bin/html.sh b/bin/html.sh
index e96a7210..600d37f5 100644
--- a/bin/html.sh
+++ b/bin/html.sh
@@ -10,32 +10,57 @@ cat <<EOF
 <!DOCTYPE html>
 <title>${src}</title>
 <style>
-$(./scheme -st)
+$(./scheme -s)
+
+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 { border-collapse: collapse; }
+table.Nm code.Nm { padding-right: 1ch; }
+table.foot { margin-top: 1em; }
+
 html {
+	line-height: 1.25em;
 	font-family: monospace;
-	color: var(--ansi17);
-	background-color: var(--ansi16);
+	background-color: var(--ansi0);
+	color: var(--ansi7);
+	-moz-tab-size: 4;
+	tab-size: 4;
+}
+body {
+	max-width: 80ch;
+	margin: 1em auto;
+	padding: 0 1ch;
 }
 a { color: var(--ansi4); }
 a:visited { color: var(--ansi5); }
-pre.hi {
-	-moz-tab-size: 4;
-	tab-size: 4;
+a.permalink, a.tag {
+	color: var(--ansi6);
+	text-decoration: none;
+}
+a.permalink code:target,
+h1.Sh:target a.permalink,
+h2.Ss:target a.permalink,
+a.tag:target {
+	color: var(--ansi3);
+	outline: none;
 }
-.hi.Keyword { color: var(--ansi7); }
-.hi.Macro { color: var(--ansi2); }
-.hi.Tag { color: inherit; text-decoration: underline; }
-.hi.Tag:target { color: var(--ansi11); outline: none; }
-.hi.String { color: var(--ansi6); }
-.hi.Format { color: var(--ansi14); }
-.hi.Interp { color: var(--ansi3); }
-.hi.Comment { color: var(--ansi4); }
-.hi.Todo { color: var(--ansi12); }
-.hi.DiffOld { color: var(--ansi1); }
-.hi.DiffNew { color: var(--ansi2); }
 </style>
-<a href="${GitURL}/${src}">${src} in git</a>
 EOF
 
-[ -f "$man" ] && man -P cat "${PWD}/${man}" | ./ttpre
-./hi -t -f html -o anchor "$src"
+opts='fragment'
+[ "${man}" = "README.7" ] && opts="${opts},man=%N.html"
+mandoc -T html -O "${opts}" "${man}"
+cat <<EOF
+<p>
+<a href="${GitURL}/${src}">${src} in git</a>
+EOF
+./htagml -p -f htmltags "${src}"