Add nix-shell tools, fix circleci, resolves #322

This commit is contained in:
Wolfgang Walther
2020-11-29 23:54:48 +01:00
committed by Wolfgang Walther
parent ea2e166aa1
commit b83ee94fae
7 changed files with 176 additions and 94 deletions
+33
View File
@@ -0,0 +1,33 @@
version: 2.1
jobs:
build:
docker:
- image: nixos/nix:2.3
steps:
- checkout
- run:
name: Install build script
command: nix-env -f default.nix -iA build
- run:
name: Build docs
command: postgrest-docs-build
spellcheck:
docker:
- image: nixos/nix:2.3
steps:
- checkout
- run:
name: Install spellcheck script
command: nix-env -f default.nix -iA spellcheck
- run:
name: Run spellcheck
command: postgrest-docs-spellcheck
workflows:
check:
jobs:
- build
- spellcheck
+1
View File
@@ -3,3 +3,4 @@ Pipfile.lock
*.aux *.aux
*.log *.log
diagrams/db.pdf diagrams/db.pdf
misspellings
+6 -9
View File
@@ -2,20 +2,17 @@
PostgREST docs use the reStructuredText format, check this [cheatsheet](https://github.com/ralsina/rst-cheatsheet/blob/master/rst-cheatsheet.rst) to get acquainted with it. PostgREST docs use the reStructuredText format, check this [cheatsheet](https://github.com/ralsina/rst-cheatsheet/blob/master/rst-cheatsheet.rst) to get acquainted with it.
You can use [pipenv](https://pipenv.readthedocs.io) to build the docs locally: To build the docs locally, use [nix](https://nixos.org/nix/):
```bash
pipenv install
pipenv run python livereload_docs.py
```
Or if you use [nix](https://nixos.org/nix/), you can just run:
```bash ```bash
nix-shell nix-shell
``` ```
Both of these options will build the docs and start a livereload server on `http://localhost:5500`. Once in the nix-shell you have the following commands available:
- `postgrest-docs-build`: Build the docs.
- `postgrest-docs-serve`: Build the docs and start a livereload server on `http://localhost:5500`.
- `postgrest-docs-spellcheck`: Run aspell.
## Documentation structure ## Documentation structure
-8
View File
@@ -1,8 +0,0 @@
dependencies:
pre:
- sudo apt-get install aspell
test:
override:
- cat *.rst | grep -v '^\(\.\.\| \)' | sed 's/`.*`//g' |aspell -d en_US -p ./postgrest.dict list | tee misspellings
- test ! -s misspellings
+58 -15
View File
@@ -1,17 +1,60 @@
with import (builtins.fetchGit { let
url = https://github.com/NixOS/nixpkgs-channels; # Commit of the Nixpkgs repository that we want to use.
ref = "nixos-18.09-small"; nixpkgsVersion = {
rev = "95fed28ac372c61eb83c87ad97c24b0f957827bf"; date = "2020-10-27";
}) {}; rev = "cd63096d6d887d689543a0b97743d28995bc9bc3";
tarballHash = "1wg61h4gndm3vcprdcg7rc4s1v3jkm5xd7lw8r2f67w502y94gcy";
};
stdenv.mkDerivation { # Nix files that describe the Nixpkgs repository. We evaluate the expression
name = "postgrest-docs"; # using `import` below.
buildInputs = [ pkgs = import
python36Full (fetchTarball {
python36Packages.sphinx url = "https://github.com/nixos/nixpkgs/archive/${nixpkgsVersion.rev}.tar.gz";
python36Packages.sphinx_rtd_theme sha256 = nixpkgsVersion.tarballHash;
python36Packages.livereload ]; })
shellHook = '' { };
python livereload_docs.py && exit
''; python = pkgs.python3.withPackages (ps: [ ps.sphinx ps.sphinx_rtd_theme ps.livereload ]);
in
{
inherit pkgs;
build =
pkgs.writeShellScriptBin "postgrest-docs-build"
''
set -euo pipefail
# clean previous build, otherwise some errors might be supressed
rm -rf _build
${python}/bin/sphinx-build -W -b html -a -n . _build
'';
serve =
pkgs.writeShellScriptBin "postgrest-docs-serve"
''
set -euo pipefail
# livereload_docs.py needs to find "sphinx-build"
PATH=${python}/bin:$PATH
${python}/bin/python livereload_docs.py
'';
spellcheck =
pkgs.writeShellScriptBin "postgrest-docs-spellcheck"
''
set -euo pipefail
FILES=$(find . -type f -iname '*.rst' | tr '\n' ' ')
cat $FILES \
| grep -v '^\(\.\.\| \)' \
| sed 's/`.*`//g' \
| ${pkgs.aspell}/bin/aspell -d ${pkgs.aspellDicts.en}/lib/aspell/en_US -p ./postgrest.dict list \
| sort -f \
| tee misspellings
test ! -s misspellings
'';
} }
+62 -62
View File
@@ -1,134 +1,134 @@
personal_ws-1.1 en 0 utf-8 personal_ws-1.1 en 0 utf-8
AMQP AMQP
Auth
Bool
CSV
Codd
DDL
DoS
GHC
GUC
Github
Google
GraphQL
HMAC
HTTPS
HV
Haskell
Heroku
Homebrew
ILIKE
IP
JS
JSON
JWK
JWT
Kinesis
Logins
MVCC
Mithril
NGINX
Nginx
OAuth
ORM
OpenAPI
PaaS
PostGIS
PostgREST
PostgREST's
PostgreSQL
PostgreSQL's
RDS
RESTful
RLS
RSA
RabbitMQ
RestSharp
SHA
SIGUSR1
SNS
SQL
SSL
Sencha
SuperAgent
Tcl
TypeScript
UI
Vondra
WAI
Websockets
ZeroMQ
api api
aud aud
Auth
auth auth
authenticator authenticator
balancer balancer
Bool
cd cd
centric centric
Codd
conf conf
config config
cryptographically cryptographically
CSV
csv csv
DDL
disjoined disjoined
DoS
eq eq
filename filename
fts fts
GHC
Github
Google
grantor grantor
GraphQL
gte gte
GUC
Haskell
Heroku
HMAC
Homebrew
http http
HTTPS
HV
ILIKE
ilike ilike
IP
JS
JSON
json json
JWK
JWT
jwt jwt
Kinesis
localhost localhost
login login
Logins
logins logins
lon lon
lt lt
lte lte
middleware middleware
Mithril
multi multi
MVCC
namespaced namespaced
neq neq
NGINX
Nginx
ngrep ngrep
nullsfirst nullsfirst
nullslast nullslast
nxl nxl
nxr nxr
OAuth
OpenAPI
openapi openapi
ORM
ov ov
PaaS
param param
params params
passphrase passphrase
pgSQL
pgcrypto pgcrypto
pgjwt pgjwt
pgSQL
phfts phfts
plfts plfts
PostGIS
PostgreSQL
PostgreSQL's
PostgREST
postgrest postgrest
PostgREST's
pre pre
RabbitMQ
RDS
reallyreallyreallyreallyverysafe reallyreallyreallyreallyverysafe
refactor refactor
requester's requester's
RESTful
RestSharp
RLS
RSA
savepoint savepoint
schemas schemas
Sencha
SHA
signup signup
SIGUSR
sl sl
SNS
sqitch sqitch
SQL
sql sql
sr sr
SSL
startup startup
stateful stateful
stdout stdout
SuperAgent
syslog syslog
Tcl
tsquery tsquery
TypeScript
UI
ui
unicode unicode
UPSERT
Upsert
uri uri
url url
urls urls
verifier verifier
versioning versioning
Vondra
WAI
Websockets
webuser webuser
wildcard wildcard
Upsert ZeroMQ
UPSERT
ui
+16
View File
@@ -0,0 +1,16 @@
let
docs =
import ./default.nix;
pkgs =
docs.pkgs;
in
pkgs.mkShell {
name = "postgrest-docs";
buildInputs = [
docs.build
docs.serve
docs.spellcheck
];
}