Explorar el Código

Add `make server` command to preview docs

Daniel Gasienica hace 12 años
padre
commit
b4df0b17af
Se han modificado 2 ficheros con 5 adiciones y 1 borrados
  1. 4 0
      docs/Makefile
  2. 1 1
      docs/README.md

+ 4 - 0
docs/Makefile

@@ -6,6 +6,7 @@ SPHINXOPTS    =
 SPHINXBUILD   = sphinx-build
 SPHINXBUILD   = sphinx-build
 PAPER         =
 PAPER         =
 BUILDDIR      = _build
 BUILDDIR      = _build
+PYTHON        = python
 
 
 # Internal variables.
 # Internal variables.
 PAPEROPT_a4     = -D latex_paper_size=a4
 PAPEROPT_a4     = -D latex_paper_size=a4
@@ -38,6 +39,7 @@ help:
 #	@echo "  linkcheck  to check all external links for integrity"
 #	@echo "  linkcheck  to check all external links for integrity"
 #	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 #	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
 	@echo "  docs       to build the docs and copy the static files to the outputdir"
 	@echo "  docs       to build the docs and copy the static files to the outputdir"
+	@echo "  server     to serve the docs in your browser under \`http://localhost:8000\`"
 	@echo "  publish    to publish the app to dotcloud"
 	@echo "  publish    to publish the app to dotcloud"
 
 
 clean:
 clean:
@@ -49,6 +51,8 @@ docs:
 	@echo
 	@echo
 	@echo "Build finished. The documentation pages are now in $(BUILDDIR)/html."
 	@echo "Build finished. The documentation pages are now in $(BUILDDIR)/html."
 
 
+server:
+	@cd $(BUILDDIR)/html; $(PYTHON) -m SimpleHTTPServer 8000
 
 
 site:
 site:
 	cp -r website $(BUILDDIR)/
 	cp -r website $(BUILDDIR)/

+ 1 - 1
docs/README.md

@@ -23,7 +23,7 @@ Usage
 * change the .rst files with your favorite editor to your liking
 * change the .rst files with your favorite editor to your liking
 * run *make docs* to clean up old files and generate new ones
 * run *make docs* to clean up old files and generate new ones
 * your static website can now be found in the _build dir
 * your static website can now be found in the _build dir
-* to preview what you have generated, cd into _build/html and then run 'python -m SimpleHTTPServer 8000'
+* to preview what you have generated run `make server` and open <http://localhost:8000/> in your favorite browser.
 
 
 Working using github's file editor
 Working using github's file editor
 ----------------------------------
 ----------------------------------