Make the quick target more readable

This commit is contained in:
Griatch 2020-04-05 16:50:52 +02:00
parent cb975f1b16
commit 4e730120ee
4 changed files with 37 additions and 33 deletions

View file

@ -3,7 +3,7 @@
# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SPHINXMULTIVERSION ?= sphinx-multiversion
SPHINXAPIDOC ?= sphinx-apidoc
@ -40,7 +40,7 @@ help:
# Evennia - custom commands
# helper targets
# helper targets
_check-env:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) bash -e checkenv.sh
@ -59,7 +59,7 @@ _build:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html"
_quick-build:
NOAUTODOC=1 EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html" $(QUICKFILES)
@NOAUTODOC=1 EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXBUILD) $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html" $(QUICKFILES)
_multiversion-build:
@EVDIR=$(EVDIR) EVGAMEDIR=$(EVGAMEDIR) $(SPHINXMULTIVERSION) $(SPHINXOPTS) "$(SOURCEDIR)" "$(BUILDDIR)/html" $(SPHINXOPTS)
@ -67,7 +67,7 @@ _multiversion-build:
_multiversion-deploy:
@bash -e deploy.sh
# main targets
# main targets
install:
@pip install -r requirements.txt
@ -83,9 +83,9 @@ quick:
@echo ""
@echo "Documentation built (no autodocs). \nTo see result, open evennia/docs/build/html/index.html in a browser."
local:
local:
make _check-env
make clean
make clean
make _autodoc-index
make _build
@echo ""

View file

@ -55,13 +55,10 @@ release = '0.9'
extensions = [
"recommonmark",
"sphinx_multiversion",
"sphinx.ext.napoleon",
"sphinx.ext.autosectionlabel"
]
if not os.environ.get("NOAUTODOC"):
extensions.append("sphinx.ext.napoleon")
# make sure sectionlabel references can be used as path/to/file:heading
autosectionlabel_prefix_document = True
@ -74,6 +71,8 @@ templates_path = ['_templates']
exclude_patterns = []
# -- Options for HTML output -------------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
@ -102,12 +101,34 @@ smv_outputdir_format = "versions" + sep + "{config.release}"
# dynamic setup
github_doc_root = "https://github.com/evennia/tree/master/docs"
github_code_root = "https://github.com/evennia/tree/master/"
github_doc_root = "https://github.com/evennia/tree/master/docs/sources/"
def url_resolver(url):
print(f"in url_resolver: {url}")
if url.startswith("github:"):
return github_code_root + url[7:]
else:
return github_doc_root + url
_NO_AUTODOC = os.environ.get("NOAUTODOC")
def autodoc_skip_member(app, what, name, obj, skip, options):
if _NO_AUTODOC:
return True
return False
if _NO_AUTODOC:
exclude_patterns = ["api/*"]
def setup(app):
# recommonmark setup
app.connect("autodoc-skip-member", autodoc_skip_member)
app.add_config_value('recommonmark_config', {
'url_resolver': lambda url: github_doc_root + url,
'url_resolver': url_resolver,
'auto_toc_tree_section': 'Contents',
}, True)
app.add_transform(AutoStructify)

View file

@ -3,6 +3,9 @@ Evennia documentation master file, created by
# Welcome to Evennia's documentation!
Click [here](../evennia/objects/objects.py) to go to objects.py ... ..
Another [link](github:objects/objects.py) to click ...
## Indices and tables
* [genindex](genindex)

View file

@ -1,20 +0,0 @@
.. Evennia documentation master file, created by
sphinx-quickstart on Sat Apr 4 23:52:36 2020.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to Evennia's documentation!
===================================
.. toctree::
:maxdepth: 2
:caption: Contents:
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`