From 58cca2faaa01af057eafc53fbf3a81b61c88387b Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 31 Mar 2021 20:49:09 +0200 Subject: chore(tvix): Add doc build infrastructure Change-Id: I2cf67df085d0c008b5ff5efff2235a670207024a Reviewed-on: https://cl.tvl.fyi/c/depot/+/2711 Tested-by: BuildkiteCI Reviewed-by: flokli Reviewed-by: tazjin --- tvix/doc/.gitignore | 2 ++ tvix/doc/Makefile | 12 ++++++++++++ tvix/doc/default.nix | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 53 insertions(+) create mode 100644 tvix/doc/.gitignore create mode 100644 tvix/doc/Makefile create mode 100644 tvix/doc/default.nix (limited to 'tvix/doc') diff --git a/tvix/doc/.gitignore b/tvix/doc/.gitignore new file mode 100644 index 0000000000..77699ee8a3 --- /dev/null +++ b/tvix/doc/.gitignore @@ -0,0 +1,2 @@ +*.svg +*.html diff --git a/tvix/doc/Makefile b/tvix/doc/Makefile new file mode 100644 index 0000000000..ba9e2bdef6 --- /dev/null +++ b/tvix/doc/Makefile @@ -0,0 +1,12 @@ +all: build + +puml: + plantuml *.puml -tsvg + +html: + pandoc *.md -f markdown --self-contained -t html -s -o tvix.html --csl=${CSL} + +build: puml html + +clean: + rm -f *.tex *.pdf *.png *.svg diff --git a/tvix/doc/default.nix b/tvix/doc/default.nix new file mode 100644 index 0000000000..606027424a --- /dev/null +++ b/tvix/doc/default.nix @@ -0,0 +1,39 @@ +{ pkgs, lib, ... }: + +let + + tl = pkgs.texlive.combine { + inherit (pkgs.texlive) scheme-medium wrapfig ulem capt-of + titlesec preprint enumitem paralist ctex environ svg + beamer trimspaces zhnumber changepage framed pdfpages + fvextra minted upquote ifplatform xstring; + }; + + csl = pkgs.fetchurl { + name = "numeric.csl"; + url = "https://gist.githubusercontent.com/bwiernik/8c6f39cf51ceb3a03107/raw/1d75c2d62113ffbba6ed03a47ad99bde86934f2b/APA%2520Numeric"; + sha256 = "1yfhhnhbzvhrv93baz98frmgsx5y442nzhb0l956l4j35fb0cc3h"; + }; + +in pkgs.stdenv.mkDerivation { + pname = "tvix-doc"; + version = "0.1"; + + src = lib.cleanSource ./.; + + CSL = csl; + + nativeBuildInputs = [ + pkgs.pandoc + pkgs.plantuml + tl + ]; + + installPhase = '' + runHook preInstall + mkdir -p $out + cp -v *.html $out/ + runHook postSubmit + ''; + +} -- cgit 1.4.1