From c0f74f95aaee79dfde33fa4f4c66cad0b2b344b3 Mon Sep 17 00:00:00 2001 From: Seth House Date: Fri, 13 Dec 2013 22:33:50 -0700 Subject: [PATCH] Added minor Salt Sphinx domain --- doc/_ext/saltdomain.py | 27 +++++++++++++++++++++++++++ doc/conf.py | 4 ++-- 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 doc/_ext/saltdomain.py diff --git a/doc/_ext/saltdomain.py b/doc/_ext/saltdomain.py new file mode 100644 index 0000000000..459cd48027 --- /dev/null +++ b/doc/_ext/saltdomain.py @@ -0,0 +1,27 @@ +from sphinx.locale import l_, _ + +from sphinx.domains import python as python_domain + + +class SaltModuleIndex(python_domain.PythonModuleIndex): + name = 'modindex' + localname = l_('Salt Module Index') + shortname = l_('all salt modules') + + +class SaltDomain(python_domain.PythonDomain): + name = 'salt' + label = 'Salt' + data_version = 2 + + indices = [ + SaltModuleIndex, + ] + + +# Monkey-patch the Python domain remove the python module index +python_domain.PythonDomain.indices = [] + + +def setup(app): + app.add_domain(SaltDomain) diff --git a/doc/conf.py b/doc/conf.py index 748b475f79..6fdf4acc19 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -128,13 +128,14 @@ templates_path = ['_templates'] exclude_patterns = ['_build', '_incl/*', 'ref/cli/_includes/*.rst'] extensions = [ + 'saltdomain', # Must come early 'saltdocs', 'sphinx.ext.autodoc', 'sphinx.ext.autosummary', 'sphinx.ext.extlinks', 'sphinx.ext.intersphinx', 'youtube', - 'saltautodoc' # Needs to be listed AFTER sphunx.ext.autodoc + 'saltautodoc', # Must be AFTER autodoc ] modindex_common_prefix = ['salt.'] @@ -209,7 +210,6 @@ html_show_sphinx = True html_show_copyright = True #html_use_opensearch = '' - ### Latex options latex_documents = [ ('contents', 'Salt.tex', 'Salt Documentation', 'SaltStack, Inc.', 'manual'),