Skip to content

Commit

Permalink
use markcode to doc for all .nix file
Browse files Browse the repository at this point in the history
  • Loading branch information
xieby1 committed Nov 24, 2023
1 parent 5273890 commit 1e4c5d9
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ result*
.direnv
book/
SUMMARY.md
*.nix.md
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
all: SUMMARY.md
mdbook build

NIXs = $(shell find . -name "*.nix" -not -path "./book*")
NIX_MDs = $(addsuffix .md,${NIXs})
%.md: %
markcode $< > $@

.PHONY: SUMMARY.md
SUMMARY.md: .genSUMMARY.sh
SUMMARY.md: .genSUMMARY.sh ${NIX_MDs}
./$< > $@
9 changes: 9 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
let
name = "nix_config";
pkgs = import <nixpkgs> {};
markcode = pkgs.callPackage (
pkgs.fetchFromGitHub {
owner = "xieby1";
repo = "markcode";
rev = "aab7cdedae2a90fd1dea56a81fdf85689ef9b537";
hash = "sha256-HCmtCnk3Q/Bng7QZzMm5C7nrKKNyz43yWLdv/CSuFyM=";
}
) {};
in pkgs.mkShell {
inherit name;
buildInputs = with pkgs; [
mdbook
markcode
];
}

0 comments on commit 1e4c5d9

Please sign in to comment.