Last active
November 6, 2020 04:17
-
-
Save antoinerg/e261acc8c87a3fc0f84329b1ce600ede to your computer and use it in GitHub Desktop.
convert markdown string into html file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with import <nixpkgs> {}; | |
{ string ? "# hello"}: | |
let | |
input = writeTextFile { | |
name = "index.md"; | |
text = string; | |
}; | |
in | |
stdenv.mkDerivation { | |
name = "simple-md"; | |
src = input; | |
unpackPhase = "true"; | |
installPhase = '' | |
mkdir $out | |
cp $src $out/index.md | |
cp $src $out/index.html | |
''; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment