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:
@echo "Please use 'make <target>' where <target> is one of"
@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"
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
@echo "Build finished."
fast: SPHINXOPTS += -A collapse_menu=True
fast: html
extensions/odoo_theme/static/style.css: extensions/odoo_theme/static/*.scss
@echo "Compiling stylesheets..."
pysassc $(subst .css,.scss,$@) $@

148
conf.py
View File

@ -9,6 +9,49 @@ from sphinx.util import logging
_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
extension_dir = Path('extensions')
sys.path.insert(0, str(extension_dir.absolute()))
@ -27,20 +70,6 @@ else:
)
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.
# They can be extensions coming with Sphinx (named 'sphinx.ext.*') or custom ones.
extensions = [
@ -72,35 +101,28 @@ extensions = [
'redirects',
]
# The suffix of source filenames.
source_suffix = '.rst'
todo_include_todos = False
# The master toctree document.
master_doc = 'index'
intersphinx_mapping = {
'python': ('https://docs.python.org/3/', None),
'werkzeug': ('https://werkzeug.palletsprojects.com/en/1.0.x/', None),
}
# General information about the project.
project = 'odoo'
copyright = 'Odoo S.A.'
github_user = 'odoo'
github_project = 'documentation-user'
# 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
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',
}
# The specifications of redirect rules used by the redirects extension.
redirects_file = '../redirects.txt'
@ -154,6 +176,9 @@ html_css_files = [
'css/legal.css',
]
# Monkeypatch PHP lexer to not require <?php
lexers['php'] = PhpLexer(startinline=True)
#=== Options for LaTeX output ===#
latex_elements = {
@ -176,27 +201,27 @@ latex_documents = [
('services/legal/terms/enterprise_tex', 'odoo_enterprise_agreement.tex',
'Odoo Enterprise Subscription Agreement', '', 'howto'),
('services/legal/terms/partnership_tex',
'odoo_partnership_agreement.tex', 'Odoo Partnership Agreement', '', 'howto'),
'odoo_partnership_agreement.tex', 'Odoo Partnership Agreement', '', 'howto'),
('services/legal/terms/terms_of_sale',
'terms_of_sale.tex', 'Odoo Terms of Sale', '', 'howto'),
'terms_of_sale.tex', 'Odoo Terms of Sale', '', 'howto'),
('services/legal/terms/i18n/enterprise_tex_fr', 'odoo_enterprise_agreement_fr.tex',
'Odoo Enterprise Subscription Agreement (FR)', '', 'howto'),
'Odoo Enterprise Subscription Agreement (FR)', '', 'howto'),
('services/legal/terms/i18n/partnership_tex_fr',
'odoo_partnership_agreement_fr.tex', 'Odoo Partnership Agreement (FR)', '', 'howto'),
'odoo_partnership_agreement_fr.tex', 'Odoo Partnership Agreement (FR)', '', 'howto'),
('services/legal/terms/i18n/terms_of_sale_fr', 'terms_of_sale_fr.tex',
u'Conditions Générales de Vente Odoo', '', 'howto'),
u'Conditions Générales de Vente Odoo', '', 'howto'),
('services/legal/terms/i18n/enterprise_tex_nl', 'odoo_enterprise_agreement_nl.tex',
'Odoo Enterprise Subscription Agreement (NL)', '', 'howto'),
'Odoo Enterprise Subscription Agreement (NL)', '', 'howto'),
('services/legal/terms/i18n/enterprise_tex_de', 'odoo_enterprise_agreement_de.tex',
'Odoo Enterprise Subscription Agreement (DE)', '', 'howto'),
'Odoo Enterprise Subscription Agreement (DE)', '', 'howto'),
('services/legal/terms/i18n/enterprise_tex_es', 'odoo_enterprise_agreement_es.tex',
'Odoo Enterprise Subscription Agreement (ES)', '', 'howto'),
'Odoo Enterprise Subscription Agreement (ES)', '', 'howto'),
('services/legal/terms/i18n/partnership_tex_es',
'odoo_partnership_agreement_es.tex', 'Odoo Partnership Agreement (ES)', '', 'howto'),
'odoo_partnership_agreement_es.tex', 'Odoo Partnership Agreement (ES)', '', 'howto'),
]
# The name of an image file (relative to this directory) to place at the top of the title page.
@ -205,31 +230,6 @@ latex_logo = 'static/img/odoo_logo.png'
# If true, show URL addresses after external links.
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):
app.connect('html-page-context', canonicalize)