File tree 3 files changed +27
-0
lines changed
3 files changed +27
-0
lines changed Original file line number Diff line number Diff line change
1
+ result
Original file line number Diff line number Diff line change @@ -11,3 +11,11 @@ http://cross-magazine.sub.jp/magazine/
11
11
Code: https://github.com/xc-jp/blog-post-code
12
12
13
13
All content is copyright Cross Compass LLC 2021.
14
+
15
+ ## Building
16
+
17
+ To locally ` pandoc ` all of the ` *.md ` files into ` result/*.html ` files,
18
+
19
+ ```
20
+ nix-build
21
+ ```
Original file line number Diff line number Diff line change
1
+ { pkgs ? import <nixpkgs> { } } :
2
+
3
+ pkgs . stdenv . mkDerivation {
4
+ name = "xc-blog-posts" ;
5
+ src = builtins . path { path = ./. ; name = "blog-posts" ; } ; # https://nix.dev/anti-patterns/language.html#reproducability-referencing-top-level-directory-with
6
+ nativeBuildInputs = [ pkgs . pandoc ] ;
7
+ phases = "unpackPhase installPhase" ;
8
+ unpackPhase = ''
9
+ cp $src/*.md ./
10
+ '' ;
11
+ installPhase = ''
12
+ mkdir -p $out
13
+ for file in *.md; do
14
+ pandoc $file --from markdown --to html --standalone --output "$out/'' ${file%%.md}.html"
15
+ done
16
+ '' ;
17
+ }
18
+
You can’t perform that action at this time.
0 commit comments