Skip to content

Commit

Permalink
nix: remove texlive dependencies from postgrest-docs-render
Browse files Browse the repository at this point in the history
  • Loading branch information
laurenceisla committed Jun 26, 2024
1 parent 295b00f commit d458114
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 123 deletions.
28 changes: 0 additions & 28 deletions docs/_diagrams/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,6 @@ You can go download erd from https://github.com/BurntSushi/erd/releases and then

The fonts used belong to the GNU FreeFont family. You can download them here: http://ftp.gnu.org/gnu/freefont/

## LaTeX

The schema structure diagram is done with LaTeX. You can use a GUI like https://www.mathcha.io/editor to create the .tex file.

Then use this command to generate the png file.

```bash
postgrest-docs-render
```

LaTeX is used because it's a tweakable plain text format.

You can install the full latex suite with `nix`:

```
nix-env -iA texlive.combined.scheme-full
```

To tweak the file with a live reload environment use:

```bash
# open the pdf(zathura used as an example)
zathura db.pdf &

# live reload with entr
echo db.tex | entr pdflatex --shell-escape -halt-on-error db.tex
```

## UML

The UML diagrams are created with https://plantuml.com/.
Expand Down
71 changes: 0 additions & 71 deletions docs/_diagrams/db.tex

This file was deleted.

24 changes: 0 additions & 24 deletions nix/tools/docs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
, aspellDicts
, buildToolbox
, checkedShellScript
, imagemagick
, python3
, python3Packages
, texlive
, writers
, plantuml
}:
Expand Down Expand Up @@ -61,35 +59,13 @@ let
'';

render =
let
pdflatex = texlive.combine {
inherit (texlive)
amsmath
booktabs
cancel
gensymb
mathdots
multirow
pgf
pgf-blur
scheme-basic
siunitx
standalone
yhmath
;
};
in
checkedShellScript
{
name = "postgrest-docs-render";
docs = "Render the diagrams.";
workingDir = "/docs/_diagrams";
withTmpDir = true;
}
''
${pdflatex}/bin/pdflatex -halt-on-error -output-directory="$tmpdir" db.tex
${imagemagick}/bin/convert -density 300 "$tmpdir/db.pdf" ../_static/db.png
${plantuml}/bin/plantuml -tsvg uml/*.uml -o ../../_static
${plantuml}/bin/plantuml -tsvg -darkmode uml/dark/*.uml -o ../../../_static
'';
Expand Down

0 comments on commit d458114

Please sign in to comment.