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:50 +01:00
parent 1b855d805e
commit 4954859d68
19 changed files with 21 additions and 16 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@v25
- run: nix-env -f default.nix -iA build
- run: nix-env -f docs/default.nix -iA build
- run: postgrest-docs-build
- run: git diff --exit-code HEAD locales || echo "Please commit changes to the locales/ folder after running postgrest-docs-build."
@@ -27,7 +27,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- run: nix-env -f default.nix -iA spellcheck
- run: nix-env -f docs/default.nix -iA spellcheck
- run: postgrest-docs-spellcheck
dictcheck:
@@ -36,7 +36,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- run: nix-env -f default.nix -iA dictcheck
- run: nix-env -f docs/default.nix -iA dictcheck
- run: postgrest-docs-dictcheck
linkcheck:
@@ -46,6 +46,6 @@ jobs:
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25
- 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.
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
export LC_ALL=${LC_ALL:-C}
function build() {
sphinx-build --color -W -a -n docs -b "$@"
sphinx-build --color -W -a -n . -b "$@"
}
if [ $# -eq 0 ]; then
+8 -3
View File
@@ -33,6 +33,7 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-build"
''
set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
# build.sh needs to find "sphinx-build"
PATH=${python}/bin:$PATH
@@ -44,6 +45,7 @@ rec {
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
@@ -55,8 +57,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 '^\(\.\.\| \)' \
@@ -72,8 +75,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 \
@@ -88,8 +92,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 =
@@ -13,6 +13,6 @@ else:
call(build, shell=True)
server = Server()
server.watch('docs/**/*.rst', shell(build))
server.watch('**/*.rst', shell(build))
server.watch(f'locales/{locale}/LC_MESSAGES/*.po', shell(build))
server.serve(root=f'_build/html/{locale}')
View File