This Sphinx extension provides a tool for easy sphinx domain creation.
pip install sphinxcontrib-domaintools
In this example there is created a simple domain for GNU Make:
from sphinxcontrib.domaintools import custom_domain
def setup(app):
app.add_domain(custom_domain('GnuMakeDomain',
name = 'make',
label = "GNU Make",
elements = dict(
target = dict(
objname = "Make Target",
indextemplate = "pair: %s; Make Target",
),
var = dict(
objname = "Make Variable",
indextemplate = "pair: %s; Make Variable"
),
)))
Complete example you find in sphinxcontrib.makedomain package.
A more complex example you can find in sphinxcontrib-cmakedomain package.
New BSD License.