Skip to content

Instantly share code, notes, and snippets.

@antoinerg
Last active November 6, 2020 04:17
Show Gist options
  • Save antoinerg/e261acc8c87a3fc0f84329b1ce600ede to your computer and use it in GitHub Desktop.
Save antoinerg/e261acc8c87a3fc0f84329b1ce600ede to your computer and use it in GitHub Desktop.
convert markdown string into html file
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