summary refs log tree commit diff
path: root/Documentation
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-02-27 13:53:10 +0000
committerAlyssa Ross <hi@alyssa.is>2022-03-06 11:19:29 +0000
commitd9fe64d3816c978c2845f0bddf7b09c1fa863e7e (patch)
tree30ad675f17b1cae5dd397b76ee41fd81718af82b /Documentation
parent29f4bfafbba4c91774fbe0273b41c189a6da065c (diff)
downloadspectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.tar
spectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.tar.gz
spectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.tar.bz2
spectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.tar.lz
spectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.tar.xz
spectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.tar.zst
spectrum-d9fe64d3816c978c2845f0bddf7b09c1fa863e7e.zip
Documentation: add build system
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/.gitignore4
-rw-r--r--Documentation/Makefile33
-rw-r--r--Documentation/default.nix27
3 files changed, 64 insertions, 0 deletions
diff --git a/Documentation/.gitignore b/Documentation/.gitignore
new file mode 100644
index 0000000..02e2069
--- /dev/null
+++ b/Documentation/.gitignore
@@ -0,0 +1,4 @@
+# SPDX-License-Identifier: CC0-1.0
+# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+
+*.html
diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644
index 0000000..59bc3ae
--- /dev/null
+++ b/Documentation/Makefile
@@ -0,0 +1,33 @@
+# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-License-Identifier: EUPL-1.2
+
+ASCIIDOCTOR = asciidoctor
+
+prefix = /usr/local
+datarootdir = $(prefix)/share
+docdir = $(datarootdir)/doc/spectrum
+
+SOURCES = \
+	creating-vms.adoc \
+	development.adoc \
+	getting-spectrum.adoc \
+	index.adoc \
+	running-vms.adoc \
+	user-partition.adoc
+
+all: $(SOURCES:adoc=html)
+.PHONY: all
+
+.SUFFIXES: .adoc .html
+
+.adoc.html:
+	$(ASCIIDOCTOR) $<
+
+install: all
+	mkdir -p -- $(docdir)
+	cp -- $(SOURCES:adoc=html) $(docdir)
+.PHONY: install
+
+clean:
+	rm -rf *.html
+.PHONY: clean
diff --git a/Documentation/default.nix b/Documentation/default.nix
new file mode 100644
index 0000000..3f4b906
--- /dev/null
+++ b/Documentation/default.nix
@@ -0,0 +1,27 @@
+# SPDX-FileCopyrightText: 2022 Alyssa Ross <hi@alyssa.is>
+# SPDX-License-Identifier: MIT
+
+{ pkgs ? import <nixpkgs> {} }: pkgs.callPackage (
+
+{ lib, stdenv, asciidoctor }:
+
+let
+  inherit (lib) cleanSource cleanSourceWith hasSuffix;
+in
+
+stdenv.mkDerivation {
+  name = "spectrum-doc";
+
+  src = cleanSourceWith {
+    filter = name: _type: !(hasSuffix name ".html");
+    src = cleanSource ./.;
+  };
+
+  nativeBuildInputs = [ asciidoctor ];
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  enableParallelBuilding = true;
+}
+
+) { }