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: on:
push: push:
branches: branches:
- main - main
- v* - rel-*
pull_request: pull_request:
branches: branches:
- main - main
- v* - rel-*
jobs: jobs:
build: build:
@@ -17,7 +17,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25 - 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: postgrest-docs-build
- run: git diff --exit-code HEAD locales || echo "Please commit changes to the locales/ folder after running 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: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25 - 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 - run: postgrest-docs-spellcheck
dictcheck: dictcheck:
@@ -36,7 +36,7 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25 - 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 - run: postgrest-docs-dictcheck
linkcheck: linkcheck:
@@ -46,6 +46,6 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- uses: cachix/install-nix-action@v25 - 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 - run: postgrest-docs-linkcheck
+1 -1
View File
@@ -3,7 +3,7 @@ sphinx:
configuration: docs/conf.py configuration: docs/conf.py
python: python:
install: install:
- requirements: requirements.txt - requirements: docs/requirements.txt
build: build:
os: ubuntu-22.04 os: ubuntu-22.04
tools: tools:
+1 -1
View File
@@ -2,7 +2,7 @@ _build
Pipfile.lock Pipfile.lock
*.aux *.aux
*.log *.log
diagrams/db.pdf _diagrams/db.pdf
misspellings misspellings
unuseddict unuseddict
.history .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: You can go download erd from https://github.com/BurntSushi/erd/releases and then do:
```bash ```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/ 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 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) ## 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. 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} export LC_ALL=${LC_ALL:-C}
function build() { function build() {
sphinx-build --color -W -a -n docs -b "$@" sphinx-build --color -W -a -n . -b "$@"
} }
if [ $# -eq 0 ]; then if [ $# -eq 0 ]; then
+8 -3
View File
@@ -33,6 +33,7 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-build" pkgs.writeShellScriptBin "postgrest-docs-build"
'' ''
set -euo pipefail set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
# build.sh needs to find "sphinx-build" # build.sh needs to find "sphinx-build"
PATH=${python}/bin:$PATH PATH=${python}/bin:$PATH
@@ -44,6 +45,7 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-serve" pkgs.writeShellScriptBin "postgrest-docs-serve"
'' ''
set -euo pipefail set -euo pipefail
cd "$(${pkgs.git}/bin/git rev-parse --show-toplevel)/docs"
# livereload_docs.py needs to find "sphinx-build" # livereload_docs.py needs to find "sphinx-build"
PATH=${python}/bin:$PATH PATH=${python}/bin:$PATH
@@ -55,8 +57,9 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-spellcheck" pkgs.writeShellScriptBin "postgrest-docs-spellcheck"
'' ''
set -euo pipefail 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 \ cat $FILES \
| grep -v '^\(\.\.\| \)' \ | grep -v '^\(\.\.\| \)' \
@@ -72,8 +75,9 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-dictcheck" pkgs.writeShellScriptBin "postgrest-docs-dictcheck"
'' ''
set -euo pipefail 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 \ cat postgrest.dict \
| tail -n+2 \ | tail -n+2 \
@@ -88,8 +92,9 @@ rec {
pkgs.writeShellScriptBin "postgrest-docs-linkcheck" pkgs.writeShellScriptBin "postgrest-docs-linkcheck"
'' ''
set -euo pipefail 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 = check =
@@ -13,6 +13,6 @@ else:
call(build, shell=True) call(build, shell=True)
server = Server() server = Server()
server.watch('docs/**/*.rst', shell(build)) server.watch('**/*.rst', shell(build))
server.watch(f'locales/{locale}/LC_MESSAGES/*.po', shell(build)) server.watch(f'locales/{locale}/LC_MESSAGES/*.po', shell(build))
server.serve(root=f'_build/html/{locale}') server.serve(root=f'_build/html/{locale}')
View File