diff options
Diffstat (limited to 'documentation/conf.py')
-rw-r--r-- | documentation/conf.py | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/documentation/conf.py b/documentation/conf.py index 74aacc18c5..efd1a1618f 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: |
@@ -165,6 +166,24 @@ latex_elements = { | |||
165 | 'preamble': '\\setcounter{tocdepth}{2}', | 166 | 'preamble': '\\setcounter{tocdepth}{2}', |
166 | } | 167 | } |
167 | 168 | ||
169 | |||
170 | from sphinx.search import SearchEnglish | ||
171 | from sphinx.search import languages | ||
172 | class DashFriendlySearchEnglish(SearchEnglish): | ||
173 | |||
174 | # Accept words that can include hyphens | ||
175 | _word_re = re.compile(r'[\w\-]+') | ||
176 | |||
177 | js_splitter_code = """ | ||
178 | function splitQuery(query) { | ||
179 | return query | ||
180 | .split(/[^\p{Letter}\p{Number}_\p{Emoji_Presentation}-]+/gu) | ||
181 | .filter(term => term.length > 0); | ||
182 | } | ||
183 | """ | ||
184 | |||
185 | languages['en'] = DashFriendlySearchEnglish | ||
186 | |||
168 | # Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG | 187 | # Make the EPUB builder prefer PNG to SVG because of issues rendering Inkscape SVG |
169 | from sphinx.builders.epub3 import Epub3Builder | 188 | from sphinx.builders.epub3 import Epub3Builder |
170 | Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] | 189 | Epub3Builder.supported_image_types = ['image/png', 'image/gif', 'image/jpeg'] |