diff options
Diffstat (limited to 'documentation/conf.py')
-rw-r--r-- | documentation/conf.py | 33 |
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 | # |
15 | import os | 15 | import os |
16 | import re | ||
16 | import sys | 17 | import sys |
17 | import datetime | 18 | import datetime |
18 | try: | 19 | try: |
@@ -90,8 +91,9 @@ rst_prolog = """ | |||
90 | 91 | ||
91 | # external links and substitutions | 92 | # external links and substitutions |
92 | extlinks = { | 93 | extlinks = { |
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. | ||
116 | manpages_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 |
114 | intersphinx_mapping = { | 119 | intersphinx_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 | ||
137 | html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg' | 142 | html_logo = 'sphinx-static/YoctoProject_Logo_RGB.jpg' |
143 | html_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 |
159 | html_secnumber_suffix = " " | 165 | html_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. | ||
170 | latex_engine = 'xelatex' | ||
171 | latex_use_xindy = False | ||
161 | latex_elements = { | 172 | latex_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 | |||
178 | from sphinx.search import SearchEnglish | ||
179 | from sphinx.search import languages | ||
180 | class DashFriendlySearchEnglish(SearchEnglish): | ||
181 | |||
182 | # Accept words that can include hyphens | ||
183 | _word_re = re.compile(r'[\w\-]+') | ||
184 | |||
185 | js_splitter_code = r""" | ||
186 | function splitQuery(query) { | ||
187 | return query | ||
188 | .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu) | ||
189 | .filter(term => term.length > 0); | ||
190 | } | ||
191 | """ | ||
192 | |||
193 | languages['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 |
167 | from sphinx.builders.epub3 import Epub3Builder | 196 | from sphinx.builders.epub3 import Epub3Builder |
168 | Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] | 197 | Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] |