File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed
src/ansys_sphinx_theme/search Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change
1
+ Raise exception for deprecated index pattern
Original file line number Diff line number Diff line change @@ -40,9 +40,12 @@ def update_search_config(app: Sphinx) -> None:
40
40
theme_static_options ["keys" ] = ["title" , "text" , "objectID" ]
41
41
theme_static_options ["threshold" ] = theme_static_options .get ("threshold" , 0.2 )
42
42
theme_static_options ["limit" ] = theme_static_options .get ("limit" , 10 )
43
- app .add_config_value ("index_patterns" , {}, "html" )
44
43
app .config .html_theme_options ["static_search" ] = theme_static_options
45
44
45
+ # TODO (RV): Deprecate this in release 0.16.0
46
+ # https://github.com/ansys/ansys-sphinx-theme/issues/730
47
+ app .add_config_value ("index_patterns" , {}, "html" )
48
+
46
49
47
50
__all__ = [
48
51
"create_search_index" ,
Original file line number Diff line number Diff line change @@ -194,24 +194,16 @@ def create_search_index(app, exception):
194
194
included_docs = app .env .found_docs
195
195
filter_options = app .config .html_theme_options .get ("search_filters" , {})
196
196
197
+ # TODO (RV): Deprecate this in release 0.16.0
198
+ # https://github.com/ansys/ansys-sphinx-theme/issues/730
197
199
patterns = app .env .config .index_patterns or {}
198
200
if patterns :
199
- logger . error (
200
- "The 'index_patterns' is depreciated and no longer supported. "
201
+ raise TypeError (
202
+ "The 'index_patterns' is deprecated and no longer supported. "
201
203
"Please see the documentation https://sphinxdocs.ansys.com for the "
202
204
"new search configuration options."
203
205
)
204
206
205
- patterns = app .env .config .index_patterns or {}
206
- if patterns :
207
- # Raise warning that this feature will deprecate in the future
208
- logger .warning (
209
- "The 'index_patterns' configuration option is deprecated and will be removed"
210
- " in v1.5.0 onwards. "
211
- "It will index all paragraphs, titles, and literals by default. "
212
- "More information can be found in the documentation at https://sphinxdocs.ansys.com." ,
213
- )
214
-
215
207
for exclude_doc in excluded_docs :
216
208
exclude_doc = Path (exclude_doc ).resolve ()
217
209
You can’t perform that action at this time.
0 commit comments