Browse code

Add `make server` command to preview docs

Daniel Gasienica authored on 2013/06/02 13:25:51
Showing 2 changed files
... ...
@@ -6,6 +6,7 @@ SPHINXOPTS    =
6 6
 SPHINXBUILD   = sphinx-build
7 7
 PAPER         =
8 8
 BUILDDIR      = _build
9
+PYTHON        = python
9 10
 
10 11
 # Internal variables.
11 12
 PAPEROPT_a4     = -D latex_paper_size=a4
... ...
@@ -38,6 +39,7 @@ help:
38 38
 #	@echo "  linkcheck  to check all external links for integrity"
39 39
 #	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
40 40
 	@echo "  docs       to build the docs and copy the static files to the outputdir"
41
+	@echo "  server     to serve the docs in your browser under \`http://localhost:8000\`"
41 42
 	@echo "  publish    to publish the app to dotcloud"
42 43
 
43 44
 clean:
... ...
@@ -49,6 +51,8 @@ docs:
49 49
 	@echo
50 50
 	@echo "Build finished. The documentation pages are now in $(BUILDDIR)/html."
51 51
 
52
+server:
53
+	@cd $(BUILDDIR)/html; $(PYTHON) -m SimpleHTTPServer 8000
52 54
 
53 55
 site:
54 56
 	cp -r website $(BUILDDIR)/
... ...
@@ -23,7 +23,7 @@ Usage
23 23
 * change the .rst files with your favorite editor to your liking
24 24
 * run *make docs* to clean up old files and generate new ones
25 25
 * your static website can now be found in the _build dir
26
-* to preview what you have generated, cd into _build/html and then run 'python -m SimpleHTTPServer 8000'
26
+* to preview what you have generated run `make server` and open <http://localhost:8000/> in your favorite browser.
27 27
 
28 28
 Working using github's file editor
29 29
 ----------------------------------