diff options
author | EuAndreh <eu@euandre.org> | 2019-06-02 01:53:02 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2019-06-02 01:53:02 -0300 |
commit | 76bd73b24e3d05606048c0ec463f5d577c33836f (patch) | |
tree | 11136a95504c513442ce1b0b7f0bee0513795676 | |
parent | Fetch README.css from URL (diff) | |
download | dotfiles-76bd73b24e3d05606048c0ec463f5d577c33836f.tar.gz dotfiles-76bd73b24e3d05606048c0ec463f5d577c33836f.tar.xz |
Build README.org HTML in utils.nix
-rw-r--r-- | default.nix | 1 | ||||
-rw-r--r-- | utils.nix | 17 |
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/ ''; }); @@ -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: |