chore: Prepare merge of postgrest-docs into postgrest main repo

This avoids some merge conflicts to allow git blame to detect renames properly.
This commit is contained in:
Wolfgang Walther
2024-02-17 13:43:11 +01:00
parent 867dc58ecc
commit 8aa8e682a2
18 changed files with 22 additions and 17 deletions
@@ -1,14 +1,14 @@
name: CI
name: Docs
on:
push:
branches:
- main
- v*
- rel-*
pull_request:
branches:
- main
- v*
- rel-*
jobs:
build:
@@ -17,7 +17,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- run: nix-env -f default.nix -iA build
- run: nix-env -f docs/default.nix -iA build
- run: postgrest-docs-build
spellcheck:
@@ -26,7 +26,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- run: nix-env -f default.nix -iA spellcheck
- run: nix-env -f docs/default.nix -iA spellcheck
- run: postgrest-docs-spellcheck
dictcheck:
@@ -35,7 +35,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- run: nix-env -f default.nix -iA dictcheck
- run: nix-env -f docs/default.nix -iA dictcheck
- run: postgrest-docs-dictcheck
linkcheck:
@@ -45,6 +45,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v23
- run: nix-env -f default.nix -iA linkcheck
- run: nix-env -f docs/default.nix -iA linkcheck
- run: postgrest-docs-linkcheck
+1 -1
View File
@@ -3,7 +3,7 @@ sphinx:
configuration: docs/conf.py
python:
install:
- requirements: requirements.txt
- requirements: docs/requirements.txt
build:
os: ubuntu-22.04
tools:
+1 -1
View File
@@ -2,7 +2,7 @@ _build
Pipfile.lock
*.aux
*.log
diagrams/db.pdf
_diagrams/db.pdf
misspellings
unuseddict
.history
View File
@@ -5,7 +5,7 @@ The ER diagrams were created with https://github.com/BurntSushi/erd/.
You can go download erd from https://github.com/BurntSushi/erd/releases and then do:
```bash
./erd_static-x86-64 -i diagrams/film.er -o docs/_static/film.png
./erd_static-x86-64 -i film.er -o ../_static/film.png
```
The fonts used belong to the GNU FreeFont family. You can download them here: http://ftp.gnu.org/gnu/freefont/
@@ -20,7 +20,7 @@ Then use this command to generate the png file.
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 ../docs/_static/
mv db.png ../_static/
```
LaTeX is used because it's a tweakable plain text format.
+9 -4
View File
@@ -24,17 +24,19 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-build"
''
set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
# clean previous build, otherwise some errors might be supressed
rm -rf _build
${python}/bin/sphinx-build --color -W -b html -a -n docs _build
${python}/bin/sphinx-build --color -W -b html -a -n . _build
'';
serve =
pkgs.writeShellScriptBin "postgrest-docs-serve"
''
set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
# livereload_docs.py needs to find "sphinx-build"
PATH=${python}/bin:$PATH
@@ -46,8 +48,9 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-spellcheck"
''
set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
FILES=$(find docs -type f -iname '*.rst' | tr '\n' ' ')
FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ')
cat $FILES \
| grep -v '^\(\.\.\| \)' \
@@ -63,8 +66,9 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-dictcheck"
''
set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
FILES=$(find docs -type f -iname '*.rst' | tr '\n' ' ')
FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ')
cat postgrest.dict \
| tail -n+2 \
@@ -79,8 +83,9 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-linkcheck"
''
set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
${python}/bin/sphinx-build --color -b linkcheck docs _build
${python}/bin/sphinx-build --color -b linkcheck . _build
'';
check =
@@ -2,9 +2,9 @@
from livereload import Server, shell
from subprocess import call
## Build docs at startup
call(['sphinx-build', '-b', 'html', '-a', '-n', 'docs', '_build'])
call(['sphinx-build', '-b', 'html', '-a', '-n', '.', '_build'])
server = Server()
server.watch('docs/**/*.rst', shell('sphinx-build -b html -a -n docs _build'))
server.watch('**/*.rst', shell('sphinx-build -b html -a -n . _build'))
# For custom port and host
# server.serve(root='_build/', host='192.168.1.2')
server.serve(root='_build/')
View File