From 06b99607194ecb00af4c8b364c753bccb9ad9c3b Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 3 May 2008 20:15:25 +0000 Subject: [PATCH] Fix OpenSearch description generation. --- CHANGES | 3 +++ doc/config.rst | 9 ++++++--- doc/markup/misc.rst | 2 ++ sphinx/config.py | 2 +- sphinx/quickstart.py | 5 +++-- sphinx/templates/opensearch.xml | 9 +++------ 6 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index 9e5fb5736..f9135dbee 100644 --- a/CHANGES +++ b/CHANGES @@ -30,6 +30,9 @@ Bugs fixed * Lots of little fixes to the LaTeX output and style. +* Fix OpenSearch template and make template URL absolute. The + `html_use_opensearch` config value now must give the base URL. + Release 0.2 (Apr 27, 2008) ========================== diff --git a/doc/config.rst b/doc/config.rst index 6f8ea62b3..3f69c4801 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -255,9 +255,12 @@ that use Sphinx' HTMLWriter class. .. confval:: html_use_opensearch - If true, an `OpenSearch ` description file will be - output, and all pages will contain a ```` tag referring to it. - The default is ``False``. + If nonempty, an `OpenSearch ` description file will be + output, and all pages will contain a ```` tag referring to it. Since + OpenSearch doesn't support relative URLs for its search page location, the + value of this option must be the base URL from which these documents are + served (without trailing slash), e.g. ``"http://docs.python.org"``. The + default is ``''``. .. confval:: html_translator_class diff --git a/doc/markup/misc.rst b/doc/markup/misc.rst index 62ee6b67e..a2135a5da 100644 --- a/doc/markup/misc.rst +++ b/doc/markup/misc.rst @@ -75,4 +75,6 @@ exists: The automatic width is determined by rendering the content in the table, and scaling them according to their share of the total width. + By default, Sphinx uses a table layout with ``L`` for every column. + .. versionadded:: 0.2.1 diff --git a/sphinx/config.py b/sphinx/config.py index 3e64ee2af..656df2cbe 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -57,7 +57,7 @@ class Config(object): html_additional_pages = ({}, False), html_use_modindex = (True, False), html_copy_source = (True, False), - html_use_opensearch = (False, False), + html_use_opensearch = ('', False), # HTML help options htmlhelp_basename = ('pydoc', False), diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index f26a3392c..5d3eb6e32 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -135,8 +135,9 @@ html_last_updated_fmt = '%%b %%d, %%Y' #html_copy_source = True # If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. -#html_use_opensearch = False +# contain a tag referring to it. The value of this option must be the +# base URL from which the finished HTML is served. +#html_use_opensearch = '' # Output file base name for HTML help builder. htmlhelp_basename = '%(project)sdoc' diff --git a/sphinx/templates/opensearch.xml b/sphinx/templates/opensearch.xml index 1f14e9bde..4e1fec031 100644 --- a/sphinx/templates/opensearch.xml +++ b/sphinx/templates/opensearch.xml @@ -1,13 +1,10 @@ {{ project }} - {{ docstitle }} Search {{ docstitle }} utf-8 - - - - - + + {{ docstitle }} {% block extra %}{# Put e.g. an element here. #}{% endblock %}