Merge bugfix from 0.5.

This commit is contained in:
Georg Brandl 2008-12-07 23:20:45 +01:00
commit 14b401be1e
5 changed files with 22 additions and 6 deletions

View File

@ -6,7 +6,7 @@ New features added
* Configuration:
- The new ``html_add_permalinks`` config value can be used to
- The new ``html_add_permalinks`` config value can be used to
switch off the generated "paragraph sign" permalinks for each
heading and definition environment.
@ -24,6 +24,8 @@ New features added
Release 0.5.1 (in development)
==============================
* Fix the JavaScript search when html_copy_source is off.
* Fix a bug in autodoc when documenting classes with the option.
``autoclass_content = "both"`` set.

View File

@ -402,6 +402,12 @@ that use Sphinx' HTMLWriter class.
If true, the reST sources are included in the HTML build as
:file:`_sources/{name}`. The default is ``True``.
.. warning::
If this config value is set to ``False``, the JavaScript search function
will only display the titles of matching documents, and no excerpt from
the matching contents.
.. confval:: html_use_opensearch
If nonempty, an `OpenSearch <http://opensearch.org>` description file will be

View File

@ -141,6 +141,7 @@ class StandaloneHTMLBuilder(Builder):
docstitle = self.config.html_title,
shorttitle = self.config.html_short_title,
show_sphinx = self.config.html_show_sphinx,
has_source = self.config.html_copy_source,
file_suffix = self.out_suffix,
script_files = self.script_files,
sphinx_version = __version__,

View File

@ -431,7 +431,7 @@ var Search = {
listItem.slideDown(5, function() {
displayNextItem();
});
} else {
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.get('_sources/' + item[0] + '.txt', function(data) {
listItem.append($.makeSearchSummary(data, searchterms, hlterms));
Search.output.append(listItem);
@ -439,6 +439,12 @@ var Search = {
displayNextItem();
});
});
} else {
// no source available, just display title
Search.output.append(listItem);
listItem.slideDown(5, function() {
displayNextItem();
});
}
}
// search finished, update title and status message

View File

@ -105,10 +105,11 @@
{%- if builder != 'htmlhelp' %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ pathto("", 1) }}',
VERSION: '{{ release|e }}',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '{{ file_suffix }}'
URL_ROOT: '{{ pathto("", 1) }}',
VERSION: '{{ release|e }}',
COLLAPSE_MODINDEX: false,
FILE_SUFFIX: '{{ file_suffix }}',
HAS_SOURCE: {{ has_source|lower }}
};
</script>
{%- for scriptfile in script_files %}