sort conf.py sections

This commit is contained in:
Antoine Vandevenne (anv) 2021-01-29 09:27:18 +01:00
parent a1648bc645
commit d3ab54bb07
2 changed files with 78 additions and 74 deletions

View File

@ -19,6 +19,7 @@ all: html
help: help:
@echo "Please use 'make <target>' where <target> is one of" @echo "Please use 'make <target>' where <target> is one of"
@echo " html to build the documentation to HTML" @echo " html to build the documentation to HTML"
@echo " fast to build the documentation to HTML with shallow menu (faster)"
@echo " clean to delete the build files" @echo " clean to delete the build files"
clean: clean:
@ -35,6 +36,9 @@ html: extensions/odoo_theme/static/style.css
$(SPHINX_BUILD) -c $(CONFIG_DIR) -b html $(SPHINXOPTS) $(SOURCE_DIR) $(BUILD_DIR)/html $(SPHINX_BUILD) -c $(CONFIG_DIR) -b html $(SPHINXOPTS) $(SOURCE_DIR) $(BUILD_DIR)/html
@echo "Build finished." @echo "Build finished."
fast: SPHINXOPTS += -A collapse_menu=True
fast: html
extensions/odoo_theme/static/style.css: extensions/odoo_theme/static/*.scss extensions/odoo_theme/static/style.css: extensions/odoo_theme/static/*.scss
@echo "Compiling stylesheets..." @echo "Compiling stylesheets..."
pysassc $(subst .css,.scss,$@) $@ pysassc $(subst .css,.scss,$@) $@

130
conf.py
View File

@ -9,6 +9,49 @@ from sphinx.util import logging
_logger = logging.getLogger(__name__) _logger = logging.getLogger(__name__)
#=== General configuration ===#
# The version info for the project being documented, acts as replacement for |version|, also used in
# various other places throughout the built documents.
version = '12.0'
# The full version, including alpha/beta/rc tags. Acts as replacement for |release|.
release = '12.0'
# The minimal Sphinx version required to build the documentation.
needs_sphinx = '3.0.0'
# The suffix of source filenames.
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'odoo'
copyright = 'Odoo S.A.'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#language = None
# List of patterns, relative to source directory, that match files and directories to ignore when
# looking for source files.
exclude_patterns = [
'locale',
'README.*',
'bin', 'include', 'lib',
]
# The RST text role to use when the role is not specified. E.g.: `example`.
# We use 'literal' as default role for markdown compatibility: `foo` behaves like ``foo``.
# See https://docutils.sourceforge.io/docs/ref/rst/roles.html#standard-roles for other roles.
default_role = 'literal'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
#=== Extensions configuration ===#
# Add extensions directory to PYTHONPATH # Add extensions directory to PYTHONPATH
extension_dir = Path('extensions') extension_dir = Path('extensions')
sys.path.insert(0, str(extension_dir.absolute())) sys.path.insert(0, str(extension_dir.absolute()))
@ -27,20 +70,6 @@ else:
) )
odoo_dir_in_path = False odoo_dir_in_path = False
# Monkeypatch PHP lexer to not require <?php
lexers['php'] = PhpLexer(startinline=True)
#=== General configuration ===#
# The version info for the project you're documenting, acts as replacement for |version| and
# |release|, also used in various other places throughout the built documents.
version = '12.0'
# The full version, including alpha/beta/rc tags.
release = '12.0'
# If your documentation needs a minimal Sphinx version, state it here.
needs_sphinx = '3.0.0'
# The Sphinx extensions to use, as module names. # The Sphinx extensions to use, as module names.
# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or custom ones. # They can be extensions coming with Sphinx (named 'sphinx.ext.*') or custom ones.
extensions = [ extensions = [
@ -72,35 +101,28 @@ extensions = [
'redirects', 'redirects',
] ]
# The suffix of source filenames. todo_include_todos = False
source_suffix = '.rst'
# The master toctree document. intersphinx_mapping = {
master_doc = 'index' 'python': ('https://docs.python.org/3/', None),
'werkzeug': ('https://werkzeug.palletsprojects.com/en/1.0.x/', None),
}
# General information about the project. github_user = 'odoo'
project = 'odoo' github_project = 'documentation-user'
copyright = 'Odoo S.A.'
# The language for content autogenerated by Sphinx. Refer to documentation locale_dirs = ['locale/']
# for a list of supported languages. LANGUAGES = {
#language = None 'de': 'German',
'en': 'English',
# List of patterns, relative to source directory, that match files and directories to ignore when 'es': 'Spanish',
# looking for source files. 'fr': 'French',
exclude_patterns = [ 'hr': 'Croatian',
'locale', 'nl': 'Dutch',
'README.*', 'pt_BR': 'Portuguese (BR)',
'bin', 'include', 'lib', 'uk': 'Ukrainian',
] 'zh_CN': 'Chinese',
}
# The RST text role to use when the role is not specified. E.g.: `example`.
# We use 'literal' as default role for markdown compatibility: `foo` behaves like ``foo``.
# See https://docutils.sourceforge.io/docs/ref/rst/roles.html#standard-roles for other roles.
default_role = 'literal'
# If true, '()' will be appended to :func: etc. cross-reference text.
add_function_parentheses = True
# The specifications of redirect rules used by the redirects extension. # The specifications of redirect rules used by the redirects extension.
redirects_file = '../redirects.txt' redirects_file = '../redirects.txt'
@ -154,6 +176,9 @@ html_css_files = [
'css/legal.css', 'css/legal.css',
] ]
# Monkeypatch PHP lexer to not require <?php
lexers['php'] = PhpLexer(startinline=True)
#=== Options for LaTeX output ===# #=== Options for LaTeX output ===#
latex_elements = { latex_elements = {
@ -205,31 +230,6 @@ latex_logo = 'static/img/odoo_logo.png'
# If true, show URL addresses after external links. # If true, show URL addresses after external links.
latex_show_urls = "True" latex_show_urls = "True"
#=== Extensions options ===#
todo_include_todos = False
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'werkzeug': ('https://werkzeug.palletsprojects.com/en/1.0.x/', None),
}
github_user = 'odoo'
github_project = 'documentation-user'
locale_dirs = ['locale/']
LANGUAGES = {
'de': 'German',
'en': 'English',
'es': 'Spanish',
'fr': 'French',
'hr': 'Croatian',
'nl': 'Dutch',
'pt_BR': 'Portuguese (BR)',
'uk': 'Ukrainian',
'zh_CN': 'Chinese',
}
def setup(app): def setup(app):
app.connect('html-page-context', canonicalize) app.connect('html-page-context', canonicalize)