Skip to content

Instantly share code, notes, and snippets.

@jaantollander
Last active July 18, 2017 06:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaantollander/0c6bf0758706518a865aa99c98006cfa to your computer and use it in GitHub Desktop.
Save jaantollander/0c6bf0758706518a865aa99c98006cfa to your computer and use it in GitHub Desktop.
Livereload Sphinx
#!/usr/bin/env python
from livereload import Server, shell
package = "<package name>"
server = Server()
server.watch('docs/*.rst', shell('make html', cwd='docs'))
server.watch('docs/**/*.rst', shell('make html', cwd='docs'))
server.watch(f'{package}/**/*.py', shell('make html', cwd='docs'))
server.watch(f'{package}/*.py', shell('make html', cwd='docs'))
server.serve(root='docs/_build/html')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment