Skip to content
Snippets Groups Projects
Commit c33ad7a3 authored by u214892's avatar u214892
Browse files

#174 sphinx

parent 58d478b2
No related branches found
No related tags found
No related merge requests found
......@@ -67,14 +67,7 @@ coverage: ## check code coverage quickly with the default Python
$(BROWSER) htmlcov/index.html
docs: ## generate Sphinx HTML documentation, including API docs
rm -f docs/flatland*.rst
rm -f docs/modules.rst
sphinx-apidoc --force -a -e -o docs/ flatland -H "Flatland Reference"
$(MAKE) -C docs clean
cp *.md docs
$(MAKE) -C docs html
pydeps --no-config --noshow flatland -o docs/_build/html/flatland.svg
$(BROWSER) docs/_build/html/index.html
python make_docs.py
servedocs: docs ## compile the docs watching for changes
watchmedo shell-command -p '*.rst' -c '$(MAKE) -C docs html' -R -D .
......
......@@ -33,7 +33,7 @@ sys.path.insert(0, os.path.abspath('..'))
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['recommonmark', 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx']
extensions = ['recommonmark', 'sphinx.ext.autodoc', 'sphinx.ext.viewcode', 'sphinx.ext.intersphinx', 'numpydoc']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
......
#!/usr/bin/env python
import glob
import os
import shutil
import subprocess
import webbrowser
from urllib.request import pathname2url
from shutil import copyfile
def browser(pathname):
webbrowser.open("file:" + pathname2url(os.path.abspath(pathname)))
......@@ -18,10 +19,14 @@ def remove_exists(filename):
# clean docs config and html files, and rebuild everything
remove_exists('docs/flatland.rst')
remove_exists('docs/flatland*.rst')
remove_exists('docs/modules.rst')
subprocess.call(['sphinx-apidoc', '-o', 'docs/', 'flatland'])
subprocess.call(['sphinx-apidoc', '--force', '-a', '-e', '-o', 'docs/', 'flatland', '-H', '"Flatland Reference"'])
for file in glob.glob(r'./*.md'):
print(file)
shutil.copy(file, 'docs/')
os.environ["SPHINXPROJ"] = "flatland"
os.chdir('docs')
......
......@@ -6,6 +6,7 @@ benchmarker>=4.0.1
coverage>=4.5.1
Sphinx>=1.8.1
sphinx-rtd-theme>=0.4.3
numpydoc
docutils>=0.15.2
flake8>=3.7.7
flake8-eradicate>=0.2.0
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment