aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2019-06-02 01:53:02 -0300
committerEuAndreh <eu@euandre.org>2019-06-02 01:53:02 -0300
commit76bd73b24e3d05606048c0ec463f5d577c33836f (patch)
tree11136a95504c513442ce1b0b7f0bee0513795676
parentFetch README.css from URL (diff)
downloaddotfiles-76bd73b24e3d05606048c0ec463f5d577c33836f.tar.gz
dotfiles-76bd73b24e3d05606048c0ec463f5d577c33836f.tar.xz
Build README.org HTML in utils.nix
Diffstat (limited to '')
-rw-r--r--default.nix1
-rw-r--r--utils.nix17
2 files changed, 5 insertions, 13 deletions
diff --git a/default.nix b/default.nix
index abaa531..fe8faae 100644
--- a/default.nix
+++ b/default.nix
@@ -24,6 +24,7 @@ in rec {
name = "${baseAttrs.name}-docs";
buildPhase = ''
mkdir $out
+ cp ${utils.readmeOrg "dotfiles"} $out/index.html
cp -Lr public/* $out/
'';
});
diff --git a/utils.nix b/utils.nix
index 805f38a..4c180d8 100644
--- a/utils.nix
+++ b/utils.nix
@@ -65,21 +65,12 @@ in rec {
url = https://euandre.org/dotfiles/static/README.css;
sha256 = "1c26b46b68ffc68ff99b453c1d30413413422d706483bfa0f98a5e886266e7ae";
};
- orgMkDocs = title:
+ readmeOrg = title:
baseTask.overrideAttrs (baseAttrs: {
- name = "${baseAttrs.name}-docs";
- buildInputs = [ pkgs.pandoc pkgs.mkdocs ];
+ name = "${baseAttrs.name}-readme-docs";
+ buildInputs = [ pkgs.pandoc ];
buildPhase = ''
- # Convert from org-mode to markdown with pandoc
- find docs/ -type f -name '*.org' -print0 | xargs -0 -I{} pandoc -o {}.md {}.org
-
- # Give the generated markdown files to MkDocs
- mkdocs build
-
- # Build remaining one-off files
- pandoc README.org -o site/index.html --css ${readmeCss} --to=html5 --self-contained --metadata title="${title}"
-
- mv site/ $out/
+ pandoc README.org -o $out --css ${readmeCss} --to=html5 --self-contained --metadata title="${title}"
'';
});
test = testDerivations: