summaryrefslogtreecommitdiffstats
path: root/documentation/conf.py
diff options
context:
space:
mode:
Diffstat (limited to 'documentation/conf.py')
-rw-r--r--documentation/conf.py33
1 files changed, 31 insertions, 2 deletions
diff --git a/documentation/conf.py b/documentation/conf.py
index 35c5c14535..1eca8756ab 100644
--- a/documentation/conf.py
+++ b/documentation/conf.py
@@ -13,6 +13,7 @@
13# documentation root, use os.path.abspath to make it absolute, like shown here. 13# documentation root, use os.path.abspath to make it absolute, like shown here.
14# 14#
15import os 15import os
16import re
16import sys 17import sys
17import datetime 18import datetime
18try: 19try:
@@ -90,8 +91,9 @@ rst_prolog = """
90 91
91# external links and substitutions 92# external links and substitutions
92extlinks = { 93extlinks = {
93 'cve': ('https://nvd.nist.gov/vuln/detail/CVE-%s', 'CVE-%s'), 94 'bitbake_git': ('https://git.openembedded.org/bitbake%s', None),
94 'cve_mitre': ('https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s', 'CVE-%s'), 95 'cve_mitre': ('https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-%s', 'CVE-%s'),
96 'cve_nist': ('https://nvd.nist.gov/vuln/detail/CVE-%s', 'CVE-%s'),
95 'yocto_home': ('https://www.yoctoproject.org%s', None), 97 'yocto_home': ('https://www.yoctoproject.org%s', None),
96 'yocto_wiki': ('https://wiki.yoctoproject.org/wiki%s', None), 98 'yocto_wiki': ('https://wiki.yoctoproject.org/wiki%s', None),
97 'yocto_dl': ('https://downloads.yoctoproject.org%s', None), 99 'yocto_dl': ('https://downloads.yoctoproject.org%s', None),
@@ -110,6 +112,9 @@ extlinks = {
110 'wikipedia': ('https://en.wikipedia.org/wiki/%s', None), 112 'wikipedia': ('https://en.wikipedia.org/wiki/%s', None),
111} 113}
112 114
115# To be able to use :manpage:`<something>` in the docs.
116manpages_url = 'https://manpages.debian.org/{path}'
117
113# Intersphinx config to use cross reference with BitBake user manual 118# Intersphinx config to use cross reference with BitBake user manual
114intersphinx_mapping = { 119intersphinx_mapping = {
115 'bitbake': ('https://docs.yoctoproject.org/bitbake/' + bitbake_version, None) 120 'bitbake': ('https://docs.yoctoproject.org/bitbake/' + bitbake_version, None)
@@ -135,6 +140,7 @@ except ImportError:
135 sys.exit(1) 140 sys.exit(1)
136 141
137html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg' 142html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg'
143html_favicon = 'sphinx-static/favicon.ico'
138 144
139# Add any paths that contain custom static files (such as style sheets) here, 145# Add any paths that contain custom static files (such as style sheets) here,
140# relative to this directory. They are copied after the builtin static files, 146# relative to this directory. They are copied after the builtin static files,
@@ -158,11 +164,34 @@ html_last_updated_fmt = '%b %d, %Y'
158# Remove the trailing 'dot' in section numbers 164# Remove the trailing 'dot' in section numbers
159html_secnumber_suffix = " " 165html_secnumber_suffix = " "
160 166
167# We need XeTeX to process special unicode character, sometimes the contributor
168# list from the release note contains those.
169# See https://docs.readthedocs.io/en/stable/guides/pdf-non-ascii-languages.html.
170latex_engine = 'xelatex'
171latex_use_xindy = False
161latex_elements = { 172latex_elements = {
162 'passoptionstopackages': '\\PassOptionsToPackage{bookmarksdepth=5}{hyperref}', 173 'passoptionstopackages': '\\PassOptionsToPackage{bookmarksdepth=5}{hyperref}',
163 'preamble': '\\setcounter{tocdepth}{2}', 174 'preamble': '\\usepackage[UTF8]{ctex}\n\\setcounter{tocdepth}{2}',
164} 175}
165 176
177
178from sphinx.search import SearchEnglish
179from sphinx.search import languages
180class DashFriendlySearchEnglish(SearchEnglish):
181
182 # Accept words that can include hyphens
183 _word_re = re.compile(r'[\w\-]+')
184
185 js_splitter_code = r"""
186function splitQuery(query) {
187 return query
188 .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu)
189 .filter(term => term.length > 0);
190}
191"""
192
193languages['en'] = DashFriendlySearchEnglish
194
166# Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG 195# Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG
167from sphinx.builders.epub3 import Epub3Builder 196from sphinx.builders.epub3 import Epub3Builder
168Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] 197Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg']