nix: Add postgrest-docs-render to render latex documents

This commit is contained in:
Wolfgang Walther
2024-02-21 09:40:11 +01:00
committed by Wolfgang Walther
parent b8f35d880f
commit 1a141c19df
2 changed files with 17 additions and 4 deletions
+1 -4
View File
@@ -17,10 +17,7 @@ The schema structure diagram is done with LaTeX. You can use a GUI like https://
Then use this command to generate the png file.
```bash
pdflatex --shell-escape -halt-on-error db.tex
## and move it to the static folder(it's not easy to do it in one go with the pdflatex)
mv db.png ../_static/
postgrest-docs-render
```
LaTeX is used because it's a tweakable plain text format.
+16
View File
@@ -2,8 +2,10 @@
, aspellDicts
, buildToolbox
, checkedShellScript
, imagemagick
, python3
, python3Packages
, texlive
, writers
}:
let
@@ -56,6 +58,19 @@ let
fi
'';
render =
checkedShellScript
{
name = "postgrest-docs-render";
docs = "Render the diagrams.";
workingDir = "/docs/_diagrams";
withTmpDir = true;
}
''
${texlive.combined.scheme-full}/bin/pdflatex -halt-on-error -output-directory="$tmpdir" db.tex
${imagemagick}/bin/convert -density 300 "$tmpdir/db.pdf" ../_static/db.png
'';
server =
writers.writePython3
"postgrest-docs-server"
@@ -165,6 +180,7 @@ buildToolbox
check
dictcheck
linkcheck
render
serve
spellcheck
];