mirror of
https://github.com/dunyakirkali/letterpress.git
synced 2026-08-24 20:36:12 +00:00
Fix diagram rendering in Nix builds
This commit is contained in:
9
.devcontainer/devcontainer-lock.json
Normal file
9
.devcontainer/devcontainer-lock.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"features": {
|
||||
"ghcr.io/devcontainers/features/nix:1": {
|
||||
"version": "1.3.1",
|
||||
"resolved": "ghcr.io/devcontainers/features/nix@sha256:8953a9da475055d140db0ede314e8e1b117d28c1eabf289c1b07c7619ce6c078",
|
||||
"integrity": "sha256:8953a9da475055d140db0ede314e8e1b117d28c1eabf289c1b07c7619ce6c078"
|
||||
}
|
||||
}
|
||||
}
|
||||
3
Makefile
3
Makefile
@@ -13,7 +13,8 @@ EPUB_NAME := book.epub
|
||||
EPUB_PATH := output/$(EPUB_NAME)
|
||||
|
||||
ASCIIDOC_FLAGS = \
|
||||
--doctype book
|
||||
--doctype book \
|
||||
--failure-level ERROR
|
||||
|
||||
.PHONY: all count clean lint epubcheck
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ Everything you need to get started is included in the package
|
||||
## Development environment
|
||||
|
||||
Letterpress ships a [Nix flake](flake.nix) that pins the entire toolchain
|
||||
(Asciidoctor, asciidoctor-pdf/epub3/diagram/mathematical, PlantUML, Graphviz,
|
||||
a JRE, Vale and EPUBCheck). This is the same environment used in CI, so builds
|
||||
(Asciidoctor, asciidoctor-pdf/epub3/diagram/mathematical, PlantUML, Mermaid,
|
||||
Graphviz, a JRE, Vale and EPUBCheck). This is the same environment used in CI, so builds
|
||||
are reproducible everywhere.
|
||||
|
||||
### Enter the dev shell
|
||||
|
||||
@@ -31,12 +31,13 @@
|
||||
};
|
||||
|
||||
# Everything needed to render the book: the gem env plus the external
|
||||
# binaries asciidoctor-diagram shells out to (plantuml -> java + graphviz).
|
||||
# binaries asciidoctor-diagram shells out to.
|
||||
runtimeInputs = with pkgs; [
|
||||
gems
|
||||
gems.wrappedRuby
|
||||
gnumake
|
||||
plantuml
|
||||
mermaid-cli
|
||||
graphviz
|
||||
jre
|
||||
vale
|
||||
@@ -48,6 +49,7 @@
|
||||
version = "0.1.0";
|
||||
src = ./.;
|
||||
nativeBuildInputs = runtimeInputs;
|
||||
DIAGRAM_PLANTUML_CLASSPATH = "${pkgs.plantuml}/lib/plantuml.jar";
|
||||
# asciidoctor-diagram caches into $HOME
|
||||
buildPhase = ''
|
||||
export HOME=$TMPDIR
|
||||
@@ -68,6 +70,7 @@
|
||||
|
||||
devShells.default = pkgs.mkShell {
|
||||
packages = runtimeInputs ++ (with pkgs; [ bundix ]);
|
||||
DIAGRAM_PLANTUML_CLASSPATH = "${pkgs.plantuml}/lib/plantuml.jar";
|
||||
shellHook = ''
|
||||
echo "letterpress dev shell"
|
||||
echo " make build PDF + EPUB"
|
||||
|
||||
Reference in New Issue
Block a user