mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
move templating from searchtools
to documentation_options
This commit is contained in:
parent
d2a15f4035
commit
67cb316ba2
@ -6,5 +6,19 @@ 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'}},
|
||||||
|
SEARCH_LANGUAGE_STOP_WORDS: {{ search_language_stop_words }}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
{% if search_language_stemming_code %}
|
||||||
|
/* Non-minified version JS is _stemmer.js if file is provided */ {% endif -%}
|
||||||
|
{{ search_language_stemming_code|safe }}
|
||||||
|
|
||||||
|
{% if search_scorer_tool %}
|
||||||
|
{{ search_scorer_tool|safe }}
|
||||||
|
{% endif -%}
|
||||||
|
|
||||||
|
{% if search_word_splitter_code %}
|
||||||
|
{{ search_word_splitter_code }}
|
||||||
|
{% endif -%}
|
||||||
|
@ -9,13 +9,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
{% if search_language_stemming_code %}
|
if (!Scorer) {
|
||||||
/* Non-minified version JS is _stemmer.js if file is provided */ {% endif -%}
|
|
||||||
{{ search_language_stemming_code|safe }}
|
|
||||||
|
|
||||||
{% if search_scorer_tool %}
|
|
||||||
{{ search_scorer_tool|safe }}
|
|
||||||
{% else %}
|
|
||||||
/**
|
/**
|
||||||
* Simple result scoring code.
|
* Simple result scoring code.
|
||||||
*/
|
*/
|
||||||
@ -45,15 +39,13 @@ var Scorer = {
|
|||||||
// query found in terms
|
// query found in terms
|
||||||
term: 5
|
term: 5
|
||||||
};
|
};
|
||||||
{% endif %}
|
}
|
||||||
|
|
||||||
{% if search_word_splitter_code %}
|
if (!splitQuery) {
|
||||||
{{ search_word_splitter_code }}
|
|
||||||
{% else %}
|
|
||||||
function splitQuery(query) {
|
function splitQuery(query) {
|
||||||
return query.split(/\s+/);
|
return query.split(/\s+/);
|
||||||
}
|
}
|
||||||
{% endif %}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Search Module
|
* Search Module
|
||||||
@ -146,7 +138,7 @@ var Search = {
|
|||||||
*/
|
*/
|
||||||
query : function(query) {
|
query : function(query) {
|
||||||
var i;
|
var i;
|
||||||
var stopwords = {{ search_language_stop_words }};
|
var stopwords = DOCUMENTATION_OPTIONS.SEARCH_LANGUAGE_STOP_WORDS;
|
||||||
|
|
||||||
// stem the searchterms and add them to the correct list
|
// stem the searchterms and add them to the correct list
|
||||||
var stemmer = new Stemmer();
|
var stemmer = new Stemmer();
|
Loading…
Reference in New Issue
Block a user