about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-03-11 15:46:59 +0100
committersternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>2021-03-11 15:48:34 +0100
commitc8ca5b7e6baa0f6d4b01ee441400316ff5ed2d68 (patch)
tree421a0af8b2171f42d927fc09e0df2d317a9c1d2d
parent1ba2121b600938c69d5c2a82dcec2c0520a1cbdd (diff)
doc(web): render man pages to html and deploy via gh-pages
This uses htmlman from tvl's depot and should allow us to deduplicate
the documentation by removing all the stuff we explain in the man pages
from the README and just link the appropriate man page in its place.

See also: https://code.tvl.fyi/about/users/sterni/htmlman

Fingers crossed this works first try.
-rw-r--r--.github/workflows/doc.yml29
-rw-r--r--docs/web.nix35
2 files changed, 64 insertions, 0 deletions
diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml
new file mode 100644
index 0000000..b8dc786
--- /dev/null
+++ b/.github/workflows/doc.yml
@@ -0,0 +1,29 @@
+name: "Deploy Documentation"
+
+on:
+  push:
+    branches: [ master ]
+
+jobs:
+  doc:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2.3.4
+      - uses: cachix/install-nix-action@v12
+        with:
+          nix_path: nixpkgs=channel:nixos-unstable
+      - uses: cachix/cachix-action@v8
+        with:
+          name: spacecookie
+          authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
+      - name: Build web output
+        run: |
+          nix-build -A deploy docs/web.nix
+          ./result -w tmp
+      - name: Deploy output to GitHub Pages
+        uses: JamesIves/github-pages-deploy-action@4.1.0
+        with:
+          GITHUB_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
+          BRANCH: gh-pages
+          CLEAN: true
+          FOLDER: tmp
diff --git a/docs/web.nix b/docs/web.nix
new file mode 100644
index 0000000..aaaa5d7
--- /dev/null
+++ b/docs/web.nix
@@ -0,0 +1,35 @@
+{ depotSrc ? builtins.fetchGit {
+    url = "https://code.tvl.fyi";
+    ref = "canon";
+    rev = "b3f686995fe3321b7f62f0247391cc2afd8b4d8c";
+  }
+}:
+
+let
+  depot = import depotSrc { };
+in
+
+depot.users.sterni.htmlman {
+  title = "spacecookie";
+  description = ''
+    * [Source (GitHub)](https://github.com/sternenseemann/spacecookie)
+    * [Source (Mirror)](https://code.sterni.lv/spacecookie)
+
+    spacecookie is a gopher server daemon and library written in Haskell.
+
+    Below you can find the user's documentation in the form of a few man pages.
+    A more general overview of the software and installation instructions can be
+    found in the
+    [README](https://github.com/sternenseemann/spacecookie/blob/master/README.md).
+
+    The developer's documentation for the bundled library is
+    [located on Hackage](https://hackage.haskell.org/package/spacecookie).
+  '';
+  manDir = ./man;
+  pages = [
+    { name = "spacecookie";           section = 1; }
+    { name = "spacecookie.json";      section = 5; }
+    { name = "spacecookie-gophermap"; section = 5; }
+  ];
+  linkXr = "inManDir";
+}