mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
parent
b1c5915850
commit
2353253aa0
2
CHANGES
2
CHANGES
@ -159,6 +159,8 @@ Features added
|
|||||||
* #5841: apidoc: Add --extensions option to sphinx-apidoc
|
* #5841: apidoc: Add --extensions option to sphinx-apidoc
|
||||||
* #4981: C++, added an alias directive for inserting lists of declarations,
|
* #4981: C++, added an alias directive for inserting lists of declarations,
|
||||||
that references existing declarations (e.g., for making a synopsis).
|
that references existing declarations (e.g., for making a synopsis).
|
||||||
|
* #1341 the HTML search considers words that contain a search term of length
|
||||||
|
three or longer a match.
|
||||||
|
|
||||||
Bugs fixed
|
Bugs fixed
|
||||||
----------
|
----------
|
||||||
|
@ -1300,13 +1300,6 @@ that use Sphinx's HTMLWriter class.
|
|||||||
* ``dict`` -- the ``jieba`` dictionary path if want to use
|
* ``dict`` -- the ``jieba`` dictionary path if want to use
|
||||||
custom dictionary.
|
custom dictionary.
|
||||||
|
|
||||||
.. confval:: html_search_partial_matching
|
|
||||||
|
|
||||||
If true, the HTML search will consider words that contain a search term of
|
|
||||||
length three or longer a match. Default: ``True``.
|
|
||||||
|
|
||||||
.. versionadded:: 2.0
|
|
||||||
|
|
||||||
.. confval:: html_search_scorer
|
.. confval:: html_search_scorer
|
||||||
|
|
||||||
The name of a JavaScript file (relative to the configuration directory) that
|
The name of a JavaScript file (relative to the configuration directory) that
|
||||||
|
@ -549,7 +549,6 @@ class StandaloneHTMLBuilder(Builder):
|
|||||||
'show_copyright': self.config.html_show_copyright,
|
'show_copyright': self.config.html_show_copyright,
|
||||||
'show_sphinx': self.config.html_show_sphinx,
|
'show_sphinx': self.config.html_show_sphinx,
|
||||||
'has_source': self.config.html_copy_source,
|
'has_source': self.config.html_copy_source,
|
||||||
'search_partial_matching': self.config.html_search_partial_matching,
|
|
||||||
'show_source': self.config.html_show_sourcelink,
|
'show_source': self.config.html_show_sourcelink,
|
||||||
'sourcelink_suffix': self.config.html_sourcelink_suffix,
|
'sourcelink_suffix': self.config.html_sourcelink_suffix,
|
||||||
'file_suffix': self.out_suffix,
|
'file_suffix': self.out_suffix,
|
||||||
|
@ -141,7 +141,6 @@ class Config:
|
|||||||
'numfig': (False, 'env', []),
|
'numfig': (False, 'env', []),
|
||||||
'numfig_secnum_depth': (1, 'env', []),
|
'numfig_secnum_depth': (1, 'env', []),
|
||||||
'numfig_format': ({}, 'env', []), # will be initialized in init_numfig_format()
|
'numfig_format': ({}, 'env', []), # will be initialized in init_numfig_format()
|
||||||
'html_search_partial_matching': (True, 'html', []),
|
|
||||||
|
|
||||||
'math_number_all': (False, 'env', []),
|
'math_number_all': (False, 'env', []),
|
||||||
'math_eqref_format': (None, 'env', [str]),
|
'math_eqref_format': (None, 'env', [str]),
|
||||||
|
@ -6,6 +6,5 @@ var DOCUMENTATION_OPTIONS = {
|
|||||||
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}',
|
||||||
HAS_SOURCE: {{ has_source|lower }},
|
HAS_SOURCE: {{ has_source|lower }},
|
||||||
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}',
|
SOURCELINK_SUFFIX: '{{ sourcelink_suffix }}',
|
||||||
NAVIGATION_WITH_KEYS: {{ 'true' if theme_navigation_with_keys|tobool else 'false'}},
|
NAVIGATION_WITH_KEYS: {{ 'true' if theme_navigation_with_keys|tobool else 'false'}}
|
||||||
PARTIAL_SEARCH_MATCHING: {{ 'true' if search_partial_matching|tobool else 'false'}}
|
|
||||||
};
|
};
|
||||||
|
@ -392,7 +392,7 @@ var Search = {
|
|||||||
{files: titleterms[word], score: Scorer.title}
|
{files: titleterms[word], score: Scorer.title}
|
||||||
];
|
];
|
||||||
// add support for partial matches
|
// add support for partial matches
|
||||||
if (DOCUMENTATION_OPTIONS.PARTIAL_SEARCH_MATCHING && word.length > 2) {
|
if (word.length > 2) {
|
||||||
for (var w in terms) {
|
for (var w in terms) {
|
||||||
if (w.match(word)) {
|
if (w.match(word)) {
|
||||||
_o.push({files: terms[w], score: Scorer.partialTerm})
|
_o.push({files: terms[w], score: Scorer.partialTerm})
|
||||||
|
Loading…
Reference in New Issue
Block a user