Add pipenv instructions
This commit is contained in:
@@ -1 +1,2 @@
|
|||||||
_build
|
_build
|
||||||
|
Pipfile.lock
|
||||||
|
|||||||
@@ -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"
|
||||||
@@ -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.
|
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:
|
You can use [pipenv](https://pipenv.readthedocs.io) to build the docs locally:
|
||||||
|
|
||||||
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:
|
|
||||||
|
|
||||||
|
```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
|
nix-shell
|
||||||
```
|
```
|
||||||
|
|
||||||
This will build the docs and start a livereload server on `http://localhost:5500`.
|
Both of these options 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.
|
|
||||||
|
|||||||
+1
-2
@@ -8,7 +8,6 @@ stdenv.mkDerivation {
|
|||||||
python36Packages.sphinx_rtd_theme
|
python36Packages.sphinx_rtd_theme
|
||||||
python36Packages.livereload ];
|
python36Packages.livereload ];
|
||||||
shellHook = ''
|
shellHook = ''
|
||||||
sphinx-build -b html -a -n . _build
|
python livereload_docs.py && exit
|
||||||
python reload_docs.py && exit
|
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python
|
||||||
from livereload import Server, shell
|
from livereload import Server, shell
|
||||||
|
from subprocess import call
|
||||||
|
## Build docs at startup
|
||||||
|
call(['sphinx-build', '-b', 'html', '-a', '-n', '.', '_build'])
|
||||||
server = Server()
|
server = Server()
|
||||||
server.watch('*.rst', shell('sphinx-build -b html -a -n . _build'))
|
server.watch('*.rst', shell('sphinx-build -b html -a -n . _build'))
|
||||||
server.watch('tutorials/*.rst', shell('sphinx-build -b html -a -n . _build'))
|
server.watch('tutorials/*.rst', shell('sphinx-build -b html -a -n . _build'))
|
||||||
Reference in New Issue
Block a user