nix: Add postgrest-docs-render to render latex documents
This commit is contained in:
committed by
Wolfgang Walther
parent
b8f35d880f
commit
1a141c19df
@@ -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.
|
Then use this command to generate the png file.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
pdflatex --shell-escape -halt-on-error db.tex
|
postgrest-docs-render
|
||||||
|
|
||||||
## and move it to the static folder(it's not easy to do it in one go with the pdflatex)
|
|
||||||
mv db.png ../_static/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
LaTeX is used because it's a tweakable plain text format.
|
LaTeX is used because it's a tweakable plain text format.
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
, aspellDicts
|
, aspellDicts
|
||||||
, buildToolbox
|
, buildToolbox
|
||||||
, checkedShellScript
|
, checkedShellScript
|
||||||
|
, imagemagick
|
||||||
, python3
|
, python3
|
||||||
, python3Packages
|
, python3Packages
|
||||||
|
, texlive
|
||||||
, writers
|
, writers
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -56,6 +58,19 @@ let
|
|||||||
fi
|
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 =
|
server =
|
||||||
writers.writePython3
|
writers.writePython3
|
||||||
"postgrest-docs-server"
|
"postgrest-docs-server"
|
||||||
@@ -165,6 +180,7 @@ buildToolbox
|
|||||||
check
|
check
|
||||||
dictcheck
|
dictcheck
|
||||||
linkcheck
|
linkcheck
|
||||||
|
render
|
||||||
serve
|
serve
|
||||||
spellcheck
|
spellcheck
|
||||||
];
|
];
|
||||||
|
|||||||
Reference in New Issue
Block a user