mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
merge with stable
This commit is contained in:
2
CHANGES
2
CHANGES
@@ -39,6 +39,7 @@ Bugs fixed
|
||||
Thanks to Jens Hedegaard Nielsen.
|
||||
* #1781: Setting `html_domain_indices` to a list raises a type check warnings.
|
||||
|
||||
|
||||
Release 1.3 (released Mar 10, 2015)
|
||||
===================================
|
||||
|
||||
@@ -87,6 +88,7 @@ Documentation
|
||||
|
||||
* #1651: Add ``vartype`` field descritpion for python domain.
|
||||
|
||||
|
||||
Release 1.3b3 (released Feb 24, 2015)
|
||||
=====================================
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ If you finished the installation of pip, type this line in the command prompt:
|
||||
|
||||
C:\> pip install sphinx
|
||||
|
||||
After installation, type :command:`sphinx-build` on the command prompt. If
|
||||
After installation, type :command:`sphinx-build -h` on the command prompt. If
|
||||
everything worked fine, you will get a Sphinx version number and a list of
|
||||
options for this command.
|
||||
|
||||
|
||||
@@ -79,6 +79,7 @@ class Sphinx(object):
|
||||
self._extension_metadata = {}
|
||||
self._listeners = {}
|
||||
self.domains = BUILTIN_DOMAINS.copy()
|
||||
self.buildername = buildername
|
||||
self.builderclasses = BUILTIN_BUILDERS.copy()
|
||||
self.builder = None
|
||||
self.env = None
|
||||
@@ -185,7 +186,7 @@ class Sphinx(object):
|
||||
# set up the build environment
|
||||
self._init_env(freshenv)
|
||||
# set up the builder
|
||||
self._init_builder(buildername)
|
||||
self._init_builder(self.buildername)
|
||||
|
||||
def _init_i18n(self):
|
||||
"""Load translated strings from the configured localedirs if enabled in
|
||||
@@ -453,6 +454,9 @@ class Sphinx(object):
|
||||
if not ext_meta.get('version'):
|
||||
ext_meta['version'] = 'unknown version'
|
||||
except Exception:
|
||||
self.warn('extension %r returned an unsupported object from '
|
||||
'its setup() function; it should return None or a '
|
||||
'metadata dictionary' % extension)
|
||||
ext_meta = {'version': 'unknown version'}
|
||||
self._extensions[extension] = mod
|
||||
self._extension_metadata[extension] = ext_meta
|
||||
|
||||
@@ -588,6 +588,12 @@ class StandaloneHTMLBuilder(Builder):
|
||||
copyfile(jsfile, path.join(self.outdir, '_static',
|
||||
'translations.js'))
|
||||
|
||||
# copy non-minified stemmer JavaScript file
|
||||
if self.indexer is not None:
|
||||
jsfile = self.indexer.get_js_stemmer_rawcode()
|
||||
if jsfile:
|
||||
copyfile(jsfile, path.join(self.outdir, '_static', '_stemmer.js'))
|
||||
|
||||
ctx = self.globalcontext.copy()
|
||||
|
||||
# add context items for search function used in searchtools.js_t
|
||||
|
||||
@@ -13,6 +13,7 @@ import re
|
||||
from six import iteritems, itervalues, text_type, string_types
|
||||
from six.moves import cPickle as pickle
|
||||
from docutils.nodes import raw, comment, title, Text, NodeVisitor, SkipNode
|
||||
from os import path
|
||||
|
||||
from sphinx.util import jsdump, rpartition
|
||||
|
||||
@@ -42,6 +43,7 @@ class SearchLanguage(object):
|
||||
lang = None
|
||||
language_name = None
|
||||
stopwords = set()
|
||||
js_stemmer_rawcode = None
|
||||
js_stemmer_code = """
|
||||
/**
|
||||
* Dummy stemmer for languages without stemming rules.
|
||||
@@ -377,3 +379,11 @@ class IndexBuilder(object):
|
||||
search_language_stop_words = jsdump.dumps(sorted(self.lang.stopwords)),
|
||||
search_scorer_tool = self.js_scorer_code,
|
||||
)
|
||||
|
||||
def get_js_stemmer_rawcode(self):
|
||||
if self.lang.js_stemmer_rawcode:
|
||||
return path.join(
|
||||
path.dirname(path.abspath(__file__)),
|
||||
'non-minified-js',
|
||||
self.lang.js_stemmer_rawcode
|
||||
)
|
||||
|
||||
@@ -120,6 +120,7 @@ var Stemmer = JSX.require("src/danish-stemmer.jsx").DanishStemmer;
|
||||
class SearchDanish(SearchLanguage):
|
||||
lang = 'da'
|
||||
language_name = 'Danish'
|
||||
js_stemmer_rawcode = 'danish-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = danish_stopwords
|
||||
|
||||
|
||||
@@ -303,6 +303,7 @@ var Stemmer = JSX.require("src/german-stemmer.jsx").GermanStemmer;
|
||||
class SearchGerman(SearchLanguage):
|
||||
lang = 'de'
|
||||
language_name = 'German'
|
||||
js_stemmer_rawcode = 'german-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = german_stopwords
|
||||
|
||||
|
||||
@@ -363,6 +363,7 @@ var Stemmer = JSX.require("src/spanish-stemmer.jsx").SpanishStemmer;
|
||||
class SearchSpanish(SearchLanguage):
|
||||
lang = 'es'
|
||||
language_name = 'Spanish'
|
||||
js_stemmer_rawcode = 'spanish-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = spanish_stopwords
|
||||
|
||||
|
||||
@@ -113,6 +113,7 @@ var Stemmer = JSX.require("src/finnish-stemmer.jsx").FinnishStemmer;
|
||||
class SearchFinnish(SearchLanguage):
|
||||
lang = 'fi'
|
||||
language_name = 'Finnish'
|
||||
js_stemmer_rawcode = 'finnish-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = finnish_stopwords
|
||||
|
||||
|
||||
@@ -199,6 +199,7 @@ var Stemmer = JSX.require("src/french-stemmer.jsx").FrenchStemmer;
|
||||
class SearchFrench(SearchLanguage):
|
||||
lang = 'fr'
|
||||
language_name = 'French'
|
||||
js_stemmer_rawcode = 'french-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = french_stopwords
|
||||
|
||||
|
||||
@@ -227,6 +227,7 @@ var Stemmer = JSX.require("src/hungarian-stemmer.jsx").HungarianStemmer;
|
||||
class SearchHungarian(SearchLanguage):
|
||||
lang = 'hu'
|
||||
language_name = 'Hungarian'
|
||||
js_stemmer_rawcode = 'hungarian-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = hungarian_stopwords
|
||||
|
||||
|
||||
@@ -316,6 +316,7 @@ var Stemmer = JSX.require("src/italian-stemmer.jsx").ItalianStemmer;
|
||||
class SearchItalian(SearchLanguage):
|
||||
lang = 'it'
|
||||
language_name = 'Italian'
|
||||
js_stemmer_rawcode = 'italian-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = italian_stopwords
|
||||
|
||||
|
||||
@@ -120,6 +120,7 @@ var Stemmer = JSX.require("src/dutch-stemmer.jsx").DutchStemmer;
|
||||
class SearchDutch(SearchLanguage):
|
||||
lang = 'nl'
|
||||
language_name = 'Dutch'
|
||||
js_stemmer_rawcode = 'dutch-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = danish_stopwords
|
||||
|
||||
|
||||
@@ -202,6 +202,7 @@ var Stemmer = JSX.require("src/norwegian-stemmer.jsx").NorwegianStemmer;
|
||||
class SearchNorwegian(SearchLanguage):
|
||||
lang = 'no'
|
||||
language_name = 'Norwegian'
|
||||
js_stemmer_rawcode = 'norwegian-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = norwegian_stopwords
|
||||
|
||||
|
||||
1873
sphinx/search/non-minified-js/danish-stemmer.js
Normal file
1873
sphinx/search/non-minified-js/danish-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2637
sphinx/search/non-minified-js/dutch-stemmer.js
Normal file
2637
sphinx/search/non-minified-js/dutch-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2812
sphinx/search/non-minified-js/finnish-stemmer.js
Normal file
2812
sphinx/search/non-minified-js/finnish-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
3667
sphinx/search/non-minified-js/french-stemmer.js
Normal file
3667
sphinx/search/non-minified-js/french-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2506
sphinx/search/non-minified-js/german-stemmer.js
Normal file
2506
sphinx/search/non-minified-js/german-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2893
sphinx/search/non-minified-js/hungarian-stemmer.js
Normal file
2893
sphinx/search/non-minified-js/hungarian-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2978
sphinx/search/non-minified-js/italian-stemmer.js
Normal file
2978
sphinx/search/non-minified-js/italian-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
1771
sphinx/search/non-minified-js/norwegian-stemmer.js
Normal file
1771
sphinx/search/non-minified-js/norwegian-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2518
sphinx/search/non-minified-js/porter-stemmer.js
Normal file
2518
sphinx/search/non-minified-js/porter-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2817
sphinx/search/non-minified-js/portuguese-stemmer.js
Normal file
2817
sphinx/search/non-minified-js/portuguese-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2694
sphinx/search/non-minified-js/romanian-stemmer.js
Normal file
2694
sphinx/search/non-minified-js/romanian-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2232
sphinx/search/non-minified-js/russian-stemmer.js
Normal file
2232
sphinx/search/non-minified-js/russian-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
2938
sphinx/search/non-minified-js/spanish-stemmer.js
Normal file
2938
sphinx/search/non-minified-js/spanish-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
1743
sphinx/search/non-minified-js/swedish-stemmer.js
Normal file
1743
sphinx/search/non-minified-js/swedish-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
6721
sphinx/search/non-minified-js/turkish-stemmer.js
Normal file
6721
sphinx/search/non-minified-js/turkish-stemmer.js
Normal file
File diff suppressed because it is too large
Load Diff
@@ -262,6 +262,7 @@ var Stemmer = JSX.require("src/portuguese-stemmer.jsx").PortugueseStemmer;
|
||||
class SearchPortuguese(SearchLanguage):
|
||||
lang = 'pt'
|
||||
language_name = 'Portuguese'
|
||||
js_stemmer_rawcode = 'portuguese-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = portuguese_stopwords
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ var Stemmer = JSX.require("src/romanian-stemmer.jsx").RomanianStemmer;
|
||||
class SearchRomanian(SearchLanguage):
|
||||
lang = 'ro'
|
||||
language_name = 'Romanian'
|
||||
js_stemmer_rawcode = 'romanian-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = []
|
||||
|
||||
|
||||
@@ -251,6 +251,7 @@ var Stemmer = JSX.require("src/russian-stemmer.jsx").RussianStemmer;
|
||||
class SearchRussian(SearchLanguage):
|
||||
lang = 'ru'
|
||||
language_name = 'Russian'
|
||||
js_stemmer_rawcode = 'russian-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = russian_stopwords
|
||||
|
||||
|
||||
@@ -140,6 +140,7 @@ var Stemmer = JSX.require("src/swedish-stemmer.jsx").SwedishStemmer;
|
||||
class SearchSwedish(SearchLanguage):
|
||||
lang = 'sv'
|
||||
language_name = 'Swedish'
|
||||
js_stemmer_rawcode = 'swedish-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = swedish_stopwords
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ var Stemmer = JSX.require("src/turkish-stemmer.jsx").TurkishStemmer;
|
||||
class SearchTurkish(SearchLanguage):
|
||||
lang = 'tr'
|
||||
language_name = 'Turkish'
|
||||
js_stemmer_rawcode = 'turkish-stemmer.js'
|
||||
js_stemmer_code = js_stemmer
|
||||
stopwords = []
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
{% 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 %}
|
||||
|
||||
@@ -119,6 +119,10 @@ class BaseSearch(object):
|
||||
"""Required by the HTML builder."""
|
||||
return {}
|
||||
|
||||
def get_js_stemmer_rawcode(self):
|
||||
"""Required by the HTML builder."""
|
||||
return None
|
||||
|
||||
|
||||
# The built-in search adapters.
|
||||
SEARCH_ADAPTERS = {
|
||||
|
||||
Reference in New Issue
Block a user