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:
@@ -1,41 +0,0 @@
|
|||||||
name: CI
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- v*
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
- v*
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
name: Build docs
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: cachix/install-nix-action@v20
|
|
||||||
- run: nix-env -f default.nix -iA build
|
|
||||||
- run: postgrest-docs-build
|
|
||||||
|
|
||||||
spellcheck:
|
|
||||||
name: Run spellcheck
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: cachix/install-nix-action@v20
|
|
||||||
- run: nix-env -f default.nix -iA spellcheck
|
|
||||||
- run: postgrest-docs-spellcheck
|
|
||||||
|
|
||||||
linkcheck:
|
|
||||||
name: Run linkcheck
|
|
||||||
if: github.base_ref == 'main'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
- uses: cachix/install-nix-action@v20
|
|
||||||
- run: nix-env -f default.nix -iA linkcheck
|
|
||||||
- run: postgrest-docs-linkcheck
|
|
||||||
|
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
name: Docs
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- rel-*
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
- rel-*
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Build docs
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v22
|
||||||
|
- run: nix-env -f docs/default.nix -iA build
|
||||||
|
- run: postgrest-docs-build
|
||||||
|
|
||||||
|
spellcheck:
|
||||||
|
name: Run spellcheck
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v22
|
||||||
|
- run: nix-env -f docs/default.nix -iA spellcheck
|
||||||
|
- run: postgrest-docs-spellcheck
|
||||||
|
|
||||||
|
dictcheck:
|
||||||
|
name: Run dictcheck
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v22
|
||||||
|
- run: nix-env -f docs/default.nix -iA dictcheck
|
||||||
|
- run: postgrest-docs-dictcheck
|
||||||
|
|
||||||
|
linkcheck:
|
||||||
|
name: Run linkcheck
|
||||||
|
if: github.base_ref == 'main'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- uses: cachix/install-nix-action@v22
|
||||||
|
- run: nix-env -f docs/default.nix -iA linkcheck
|
||||||
|
- run: postgrest-docs-linkcheck
|
||||||
|
|
||||||
+1
-1
@@ -3,4 +3,4 @@ sphinx:
|
|||||||
configuration: docs/conf.py
|
configuration: docs/conf.py
|
||||||
python:
|
python:
|
||||||
install:
|
install:
|
||||||
- requirements: requirements.txt
|
- requirements: docs/requirements.txt
|
||||||
|
|||||||
@@ -2,5 +2,5 @@ _build
|
|||||||
Pipfile.lock
|
Pipfile.lock
|
||||||
*.aux
|
*.aux
|
||||||
*.log
|
*.log
|
||||||
diagrams/db.pdf
|
_diagrams/db.pdf
|
||||||
misspellings
|
misspellings
|
||||||
@@ -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
|
||||||
```
|
```
|
||||||
|
|
||||||
## LaTeX
|
## LaTeX
|
||||||
@@ -18,7 +18,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.
|
||||||
@@ -27,17 +27,19 @@ in
|
|||||||
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"
|
||||||
|
|
||||||
# clean previous build, otherwise some errors might be supressed
|
# clean previous build, otherwise some errors might be supressed
|
||||||
rm -rf _build
|
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 =
|
serve =
|
||||||
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
|
||||||
@@ -49,8 +51,9 @@ in
|
|||||||
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 '^\(\.\.\| \)' \
|
||||||
@@ -66,8 +69,9 @@ in
|
|||||||
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 \
|
||||||
@@ -80,7 +84,8 @@ in
|
|||||||
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
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
@@ -2,9 +2,9 @@
|
|||||||
from livereload import Server, shell
|
from livereload import Server, shell
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
## Build docs at startup
|
## Build docs at startup
|
||||||
call(['sphinx-build', '-b', 'html', '-a', '-n', 'docs', '_build'])
|
call(['sphinx-build', '-b', 'html', '-a', '-n', '.', '_build'])
|
||||||
server = Server()
|
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
|
# For custom port and host
|
||||||
# server.serve(root='_build/', host='192.168.1.2')
|
# server.serve(root='_build/', host='192.168.1.2')
|
||||||
server.serve(root='_build/')
|
server.serve(root='_build/')
|
||||||
Reference in New Issue
Block a user