summaryrefslogtreecommitdiff
path: root/sphinx
diff options
context:
space:
mode:
authorgeorg.brandl <devnull@localhost>2008-07-08 18:48:21 +0000
committergeorg.brandl <devnull@localhost>2008-07-08 18:48:21 +0000
commit5ceb259c1a8c2ab4d62705ece8e5c0eca34c625d (patch)
treeabd9b165ba94646468e4f9c9e010476dea9facf8 /sphinx
parentf5ac3748439475661f00654211bce495e42e10fc (diff)
downloadsphinx-5ceb259c1a8c2ab4d62705ece8e5c0eca34c625d.tar.gz
Merged revisions 64733,64743,64755,64795,64803 via svnmerge from
svn+ssh://pythondev@svn.python.org/doctools/branches/0.4.x ........ r64733 | georg.brandl | 2008-07-05 17:04:12 +0200 (Sat, 05 Jul 2008) | 2 lines Ask for common extensions in quickstart. ........ r64743 | georg.brandl | 2008-07-05 18:34:55 +0200 (Sat, 05 Jul 2008) | 2 lines Add a direct link to the examples page. ........ r64755 | georg.brandl | 2008-07-06 07:32:09 +0200 (Sun, 06 Jul 2008) | 2 lines Backport r64750. ........ r64795 | georg.brandl | 2008-07-08 16:48:58 +0200 (Tue, 08 Jul 2008) | 2 lines Use correct filename extension in search. ........ r64803 | georg.brandl | 2008-07-08 20:46:49 +0200 (Tue, 08 Jul 2008) | 2 lines Accept class options for modules too. ........
Diffstat (limited to 'sphinx')
-rw-r--r--sphinx/builder.py1
-rw-r--r--sphinx/ext/autodoc.py3
-rw-r--r--sphinx/quickstart.py11
-rw-r--r--sphinx/static/searchtools.js6
-rw-r--r--sphinx/templates/layout.html7
5 files changed, 21 insertions, 7 deletions
diff --git a/sphinx/builder.py b/sphinx/builder.py
index afdea2a7..f9bd9f10 100644
--- a/sphinx/builder.py
+++ b/sphinx/builder.py
@@ -378,6 +378,7 @@ class StandaloneHTMLBuilder(Builder):
docstitle = self.config.html_title,
shorttitle = self.config.html_short_title,
show_sphinx = self.config.html_show_sphinx,
+ file_suffix = self.config.html_file_suffix,
rellinks = rellinks,
builder = self.name,
parents = [],
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index 5215a5ab..9af6195d 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -560,7 +560,8 @@ def members_option(arg):
def setup(app):
mod_options = {'members': members_option, 'undoc-members': directives.flag,
- 'noindex': directives.flag, 'synopsis': lambda x: x,
+ 'noindex': directives.flag, 'inherited-members': directives.flag,
+ 'show-inheritance': directives.flag, 'synopsis': lambda x: x,
'platform': lambda x: x, 'deprecated': directives.flag}
cls_options = {'members': members_option, 'undoc-members': directives.flag,
'noindex': directives.flag, 'inherited-members': directives.flag,
diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py
index 5dfe2018..f452e212 100644
--- a/sphinx/quickstart.py
+++ b/sphinx/quickstart.py
@@ -42,7 +42,7 @@ import sys, os
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
-#extensions = []
+extensions = [%(extensions)s]
# Add any paths that contain templates here, relative to this directory.
templates_path = ['%(dot)stemplates']
@@ -397,6 +397,12 @@ document is a custom template, you can also set this to another filename.'''
do_prompt(d, 'master', 'Name of your master document (without suffix)',
'index')
print '''
+Please indicate if you want to use one of the following Sphinx extensions:'''
+ do_prompt(d, 'ext_autodoc', 'autodoc: automatically insert docstrings '
+ 'from modules (y/n)', 'n', boolean)
+ do_prompt(d, 'ext_doctest', 'doctest: automatically test code snippets '
+ 'in doctest blocks (y/n)', 'n', boolean)
+ print '''
If you are under Unix, a Makefile can be generated for you so that you
only have to run e.g. `make html' instead of invoking sphinx-build
directly.'''
@@ -407,6 +413,9 @@ directly.'''
d['year'] = time.strftime('%Y')
d['now'] = time.asctime()
d['underline'] = len(d['project']) * '='
+ d['extensions'] = ', '.join(
+ repr('sphinx.ext.' + name) for name in ('autodoc', 'doctest')
+ if d['ext_' + name].upper() in ('Y', 'YES'))
if not path.isdir(d['path']):
mkdir_p(d['path'])
diff --git a/sphinx/static/searchtools.js b/sphinx/static/searchtools.js
index a770cd6a..5fed1116 100644
--- a/sphinx/static/searchtools.js
+++ b/sphinx/static/searchtools.js
@@ -363,8 +363,10 @@ var Search = {
if (results.length) {
var item = results.pop();
var listItem = $('<li style="display:none"></li>');
- listItem.append($('<a/>').attr('href', item[0] + '.html' +
- highlightstring).html(item[1]));
+ listItem.append($('<a/>').attr(
+ 'href',
+ item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
+ highlightstring).html(item[1]));
$.get('_sources/' + item[0] + '.txt', function(data) {
listItem.append($.makeSearchSummary(data, searchwords, hlwords));
output.append(listItem);
diff --git a/sphinx/templates/layout.html b/sphinx/templates/layout.html
index ad88be66..8aad87cd 100644
--- a/sphinx/templates/layout.html
+++ b/sphinx/templates/layout.html
@@ -102,9 +102,10 @@
{%- if builder != 'htmlhelp' %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
- URL_ROOT: '{{ pathto("", 1) }}',
- VERSION: '{{ release }}',
- COLLAPSE_MODINDEX: false
+ URL_ROOT: '{{ pathto("", 1) }}',
+ VERSION: '{{ release }}',
+ COLLAPSE_MODINDEX: false,
+ FILE_SUFFIX: '{{ file_suffix }}'
};
</script>
<script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script>