Commit Diff


commit - 0f22cda88d39f783d6a3ecb9c7c51a06f5da1b4f
commit + 2ad4a6a2270c43cf655718b7b8f411dce8528e99
blob - 178e1e164cb23eb79e5ee74b9459392b9c49bf74
blob + 26af97b46ae0b54fa6d29ea7af9295f30683aa7d
--- .gitignore
+++ .gitignore
@@ -30,3 +30,6 @@ kamid/kamid
 kamiftp/kamiftp
 kamirepl/kamirepl
 ninepscript/ninepscript
+
+site/*.[1-9].html
+site/*.[1-9].txt
blob - /dev/null
blob + b317cc2a9165a44b1bf90e22bcc56c721da05116 (mode 644)
--- /dev/null
+++ site/footer.html
@@ -0,0 +1,2 @@
+    </body>
+</html>
\ No newline at end of file
blob - /dev/null
blob + b6be1ebc5963f08d2bd57afd1ae01594bf9857ab (mode 755)
--- /dev/null
+++ site/gem2html.awk
@@ -0,0 +1,98 @@
+#!/usr/bin/awk -f
+#
+# Copyright (c) 2022 Omar Polo <op@omarpolo.com>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+BEGIN {
+	in_pre = 0;
+	in_list = 0;
+}
+
+!in_pre && /^###/	{ output("<h3>", substr($0, 4), "</h3>"); next }
+!in_pre && /^##/	{ output("<h2>", substr($0, 3), "</h2>"); next }
+!in_pre && /^#/		{ output("<h1>", substr($0, 2), "</h1>"); next }
+!in_pre && /^>/		{ output("<blockquote>", substr($0, 2), "</blockquote>"); next }
+!in_pre && /^\* /	{ output("<li>", substr($0, 2), "</li>"); next }
+
+!in_pre && /^=>/ {
+	$0 = substr($0, 3);
+	link = $1;
+	$1 = "";
+	output_link(link, $0);
+	next;
+}
+
+!in_pre && /^```/ {
+	in_pre = 1;
+	if (in_list) {
+		in_list = 0;
+		print("</ul>");
+	}
+	print "<pre>";
+	next
+}
+
+in_pre && /^```/	{ in_pre = 0; print "</pre>"; next }
+!in_pre			{ output("<p>", $0, "</p>"); next }
+in_pre			{ print san($0); next }
+
+END {
+	if (in_list)
+		print "</ul>"
+	if (in_pre)
+		print "</pre>"
+}
+
+function trim(s) {
+	sub("^[ \t]*", "", s);
+	return s;
+}
+
+function san(s) {
+	gsub("&", "\\&amp;", s)
+	gsub("<", "\\&lt;", s)
+	gsub(">", "\\&gt;", s)
+	return s;
+}
+
+function output(ot, content, et) {
+	content = trim(content);
+
+	if (!in_list && ot == "<li>") {
+		in_list = 1;
+		print "<ul>";
+	}
+
+	if (in_list && ot != "<li>") {
+		in_list = 0;
+		print "</ul>";
+	}
+
+	if (ot == "<p>" && content == "")
+		return;
+
+	printf("%s%s%s\n", ot, san(content), et);
+}
+
+function output_link(link, content) {
+	if (in_list) {
+		in_list = 0;
+		print "</ul>";
+	}
+
+	if (content == "")
+		content = link;
+
+	printf("<p><a href=\"%s\">%s</a></p>\n", link, trim(san(content)));
+}
blob - /dev/null
blob + 0b91cfaf53b533670b8c39e8ae77adcf6a0c6020 (mode 644)
--- /dev/null
+++ site/header.html
@@ -0,0 +1,9 @@
+<!doctype html>
+<html lang="en">
+    <head>
+        <title>kamid</title>
+        <meta charset="utf8" />
+        <meta name="viewport" content="width=device-width, initial-scale=1" />
+        <link rel="stylesheet" href="style.css" />
+    </head>
+    <body>
blob - /dev/null
blob + dc961427cc26b06dc4aaaff090fc0b75fc354132 (mode 644)
--- /dev/null
+++ site/index.gmi
@@ -0,0 +1,10 @@
+# kamid
+
+kamid is a FREE, easy-to-use and portable implementation of a 9p file server daemon for UNIX-like systems.
+
+### Documentation
+
+=> 9p.7.html		9p.7: protocol documentation
+=> kamictl.8.html	kamictl.8: command line utility to manage the daemon
+=> kamid.8.html		kamid.8: daemon documentation
+=> kamiftp.1.html	kamiftp.1: ftp(1)-like command line utility
blob - /dev/null
blob + 62db05765f923c769681af9faa6350ca66c00a22 (mode 755)
--- /dev/null
+++ site/mdoc2html.sh
@@ -0,0 +1,44 @@
+#!/bin/sh
+#
+# Copyright (c) 2022 Omar Polo <op@omarpolo.com>
+#
+# Permission to use, copy, modify, and distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+# usage: mdoc2html.sh src out
+#
+# converts the manpage `src' to the HTML file `out', tweaking the
+# style
+
+set -e
+
+: ${1:?missing input file}
+: ${2:?missing output file}
+
+man -Thtml -l "$1" >"$2"
+
+exec ed "$2" <<EOF
+/<style>
+a
+    body {
+        max-width: 960px;
+        margin: 0 auto;
+        padding: 0 10px;
+        font-size: 1rem;
+    }
+
+    pre {
+        overflow: auto;
+    }
+.
+wq
+EOF
blob - /dev/null
blob + 1d563209b1bb1206fcab8623fae816f860ddacda (mode 644)
--- /dev/null
+++ site/style.css
@@ -0,0 +1,112 @@
+body {
+  font-family: monospace;
+  font-size: 14px;
+  max-width: 780px;
+  margin: 0 auto;
+  padding: 20px;
+  padding-bottom: 80px;
+}
+
+h1::before {
+  content: "# ";
+}
+
+h2 {
+  margin-top: 40px;
+}
+
+h2::before {
+  content: "## ";
+}
+
+h3::before {
+  content: "### ";
+}
+
+blockquote {
+  margin: 0;
+  padding: 0;
+}
+
+blockquote::before {
+  content: "> ";
+}
+
+blockquote p {
+  font-style: italic;
+  display: inline;
+}
+
+p.link::before {
+  content: "→ ";
+}
+
+strong::before { content: "*" }
+strong::after  { content: "*" }
+
+hr {
+  border: 0;
+  height: 1px;
+  background-color: #222;
+  width: 100%;
+  display: block;
+  margin: 2em auto;
+}
+
+img {
+  border-radius: 5px;
+}
+
+pre {
+  overflow: auto;
+  padding: 1rem;
+  background-color: #f0f0f0;
+  border-radius: 3px;
+}
+
+pre.banner {
+  display: flex;
+  flex-direction: row;
+  justify-content: center;
+}
+
+code, kbd {
+  color: #9d109d;
+}
+
+img {
+  display: block;
+  margin: 0 auto;
+  max-width: 100%;
+}
+
+@media (prefers-color-scheme: dark) {
+  body {
+    background-color: #222;
+    color: white;
+  }
+
+  a {
+    color: aqua;
+  }
+
+  hr {
+    background-color: #ddd;
+  }
+
+  pre {
+    background-color: #353535;
+  }
+
+  code, kbd {
+    color: #ff4cff;
+  }
+}
+
+@media (max-width: 400px) {
+  pre.banner { font-size: 9px; }
+}
+
+@media (max-width: 500px) {
+  pre.banner { font-size: 10px; }
+}