Add pipenv instructions

This commit is contained in:
steve-chavez
2018-09-21 13:46:53 -05:00
parent 518b465ffa
commit 73e59a1643
5 changed files with 28 additions and 22 deletions
+1
View File
@@ -1 +1,2 @@
_build
Pipfile.lock
+14
View File
@@ -0,0 +1,14 @@
[[source]]
url = "https://pypi.org/simple"
verify_ssl = true
name = "pypi"
[packages]
sphinx = "*"
sphinx-rtd-theme = "*"
livereload = "*"
[dev-packages]
[requires]
python_version = "3.6"
+9 -20
View File
@@ -2,28 +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.
To generate HTML version:
1. Install Sphinx from the [sphinx website](http://www.sphinx-doc.org/en/stable/install.html)
2. Clone this repository
3. Generate HTML
```bash
cd postgrest-docs
sphinx-build -b html -a -n . _build
# open _build/index.html in your browser
```
If you use [nix](https://nixos.org/nix/), you can just run:
You can use [pipenv](https://pipenv.readthedocs.io) to build the docs locally:
```bash
pipenv install
pipenv run python livereload_docs.py
```
Or if you use [nix](https://nixos.org/nix/), you can just run:
```bash
nix-shell
```
This will build the docs and start a livereload server on `http://localhost:5500`.
---
**Sphinx Installation Notes:**
* If you're on OSX you might want to install the Python from homebrew - then a simple `pip install sphinx` does the trick.
Both of these options will build the docs and start a livereload server on `http://localhost:5500`.
+1 -2
View File
@@ -8,7 +8,6 @@ stdenv.mkDerivation {
python36Packages.sphinx_rtd_theme
python36Packages.livereload ];
shellHook = ''
sphinx-build -b html -a -n . _build
python reload_docs.py && exit
python livereload_docs.py && exit
'';
}
+3
View File
@@ -1,5 +1,8 @@
#!/usr/bin/env python
from livereload import Server, shell
from subprocess import call
## Build docs at startup
call(['sphinx-build', '-b', 'html', '-a', '-n', '.', '_build'])
server = Server()
server.watch('*.rst', shell('sphinx-build -b html -a -n . _build'))
server.watch('tutorials/*.rst', shell('sphinx-build -b html -a -n . _build'))