diff options
| author | Georg Brandl <georg@python.org> | 2010-01-07 21:41:03 +0100 |
|---|---|---|
| committer | Georg Brandl <georg@python.org> | 2010-01-07 21:41:03 +0100 |
| commit | 4f2ab257185be851cd2c57f636ce990232bc1bb9 (patch) | |
| tree | 6bdd77acf8c3695f3cba5e0e80f13dfc1d8612cc /sphinx | |
| parent | 51261adf4a87e8e70838fd59fe51b031147a0d5a (diff) | |
| parent | 0483cc8635b8968643afa985fb656a450ffe41bf (diff) | |
| download | sphinx-4f2ab257185be851cd2c57f636ce990232bc1bb9.tar.gz | |
merge with trunk (not working perfectly yet)
Diffstat (limited to 'sphinx')
46 files changed, 969 insertions, 402 deletions
diff --git a/sphinx/builders/changes.py b/sphinx/builders/changes.py index 92c48f16..3bc51d43 100644 --- a/sphinx/builders/changes.py +++ b/sphinx/builders/changes.py @@ -139,11 +139,10 @@ class ChangesBuilder(Builder): self.theme.get_options({}).iteritems()) copy_static_entry(path.join(package_dir, 'themes', 'default', 'static', 'default.css_t'), - path.join(self.outdir, 'default.css_t'), - self, themectx) + self.outdir, self, themectx) copy_static_entry(path.join(package_dir, 'themes', 'basic', 'static', 'basic.css'), - path.join(self.outdir, 'basic.css'), self) + self.outdir, self) def hl(self, text, version): text = escape(text) diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py index 5c03bf80..bbd01f76 100644 --- a/sphinx/builders/html.py +++ b/sphinx/builders/html.py @@ -29,8 +29,8 @@ from docutils.frontend import OptionParser from docutils.readers.doctree import Reader as DoctreeReader from sphinx import package_dir, __version__ -from sphinx.util import SEP, os_path, relative_uri, ensuredir, \ - movefile, ustrftime, copy_static_entry, copyfile +from sphinx.util import SEP, os_path, relative_uri, ensuredir, patmatch, \ + movefile, ustrftime, copy_static_entry, copyfile, compile_matchers, any from sphinx.errors import SphinxError from sphinx.search import js_index from sphinx.theming import Theme @@ -76,6 +76,9 @@ class StandaloneHTMLBuilder(Builder): # Dito for this one. css_files = [] + default_sidebars = ['localtoc.html', 'relations.html', + 'sourcelink.html', 'searchbox.html'] + # cached publisher object for snippets _publisher = None @@ -561,30 +564,39 @@ class StandaloneHTMLBuilder(Builder): if path.isfile(jsfile): copyfile(jsfile, path.join(self.outdir, '_static', 'translations.js')) - # then, copy over all user-supplied static files + # then, copy over theme-supplied static files if self.theme: - staticdirnames = [path.join(themepath, 'static') - for themepath in self.theme.get_dirchain()[::-1]] - else: - staticdirnames = [] - staticdirnames += [path.join(self.confdir, spath) - for spath in self.config.html_static_path] - for staticdirname in staticdirnames: - if not path.isdir(staticdirname): - self.warn('static directory %r does not exist' % staticdirname) + themeentries = [path.join(themepath, 'static') + for themepath in self.theme.get_dirchain()[::-1]] + for entry in themeentries: + copy_static_entry(entry, path.join(self.outdir, '_static'), + self, self.globalcontext) + # then, copy over all user-supplied static files + staticentries = [path.join(self.confdir, spath) + for spath in self.config.html_static_path] + matchers = compile_matchers( + self.config.exclude_patterns + + ['**/' + d for d in self.config.exclude_dirnames] + ) + for entry in staticentries: + if not path.exists(entry): + self.warn('html_static_path entry %r does not exist' % entry) continue - for filename in os.listdir(staticdirname): - if filename.startswith('.'): - continue - fullname = path.join(staticdirname, filename) - targetname = path.join(self.outdir, '_static', filename) - copy_static_entry(fullname, targetname, self, - self.globalcontext) - # last, copy logo file (handled differently) + copy_static_entry(entry, path.join(self.outdir, '_static'), self, + self.globalcontext, exclude_matchers=matchers) + # copy logo and favicon files if not already in static path if self.config.html_logo: logobase = path.basename(self.config.html_logo) - copyfile(path.join(self.confdir, self.config.html_logo), - path.join(self.outdir, '_static', logobase)) + logotarget = path.join(self.outdir, '_static', logobase) + if not path.isfile(logotarget): + copyfile(path.join(self.confdir, self.config.html_logo), + logotarget) + if self.config.html_favicon: + iconbase = path.basename(self.config.html_favicon) + icontarget = path.join(self.outdir, '_static', iconbase) + if not path.isfile(icontarget): + copyfile(path.join(self.confdir, self.config.html_favicon), + icontarget) # write build info file fp = open(path.join(self.outdir, '.buildinfo'), 'w') @@ -658,6 +670,33 @@ class StandaloneHTMLBuilder(Builder): def get_outfilename(self, pagename): return path.join(self.outdir, os_path(pagename) + self.out_suffix) + def get_sidebars(self, pagename): + def has_wildcard(pattern): + return any(char in pattern for char in '*?[') + sidebars = None + matched = None + for pattern, patsidebars in self.config.html_sidebars.iteritems(): + if patmatch(pagename, pattern): + if matched: + if has_wildcard(pattern): + # warn if both patterns contain wildcards + if has_wildcard(matched): + self.warn('page %s matches two patterns in ' + 'html_sidebars: %r and %r' % + (pagename, matched, pattern)) + # else the already matched pattern is more specific + # than the present one, because it contains no wildcard + continue + matched = pattern + sidebars = patsidebars + if sidebars is None: + sidebars = self.default_sidebars + elif isinstance(sidebars, basestring): + # 0.x compatible mode: insert custom sidebar before searchbox + sidebars = self.default_sidebars[:-1] + [sidebars] + \ + self.default_sidebars[-1:] + return sidebars + # --------- these are overwritten by the serialization builder def get_target_uri(self, docname, typ=None): @@ -677,9 +716,9 @@ class StandaloneHTMLBuilder(Builder): return uri ctx['pathto'] = pathto ctx['hasdoc'] = lambda name: name in self.env.all_docs - ctx['customsidebar'] = self.config.html_sidebars.get(pagename) ctx['encoding'] = encoding = self.config.html_output_encoding ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw) + ctx['sidebars'] = self.get_sidebars(pagename) ctx.update(addctx) self.app.emit('html-page-context', pagename, templatename, @@ -803,9 +842,7 @@ class SerializingHTMLBuilder(StandaloneHTMLBuilder): def handle_page(self, pagename, ctx, templatename='page.html', outfilename=None, event_arg=None): ctx['current_page_name'] = pagename - sidebarfile = self.config.html_sidebars.get(pagename) - if sidebarfile: - ctx['customsidebar'] = sidebarfile + ctx['sidebars'] = self.get_sidebars(pagename) if not outfilename: outfilename = path.join(self.outdir, diff --git a/sphinx/config.py b/sphinx/config.py index d14a03f6..23e5698b 100644 --- a/sphinx/config.py +++ b/sphinx/config.py @@ -38,8 +38,9 @@ class Config(object): master_doc = ('contents', 'env'), source_suffix = ('.rst', 'env'), source_encoding = ('utf-8-sig', 'env'), + exclude_patterns = ([], 'env'), + # the next three are all deprecated now unused_docs = ([], 'env'), - exclude_dirs = ([], 'env'), exclude_trees = ([], 'env'), exclude_dirnames = ([], 'env'), default_role = (None, 'env'), diff --git a/sphinx/environment.py b/sphinx/environment.py index 3ae42bd5..09d15db3 100644 --- a/sphinx/environment.py +++ b/sphinx/environment.py @@ -35,7 +35,8 @@ from docutils.transforms.parts import ContentsFilter from sphinx import addnodes from sphinx.util import movefile, get_matching_docs, SEP, ustrftime, \ - docname_join, FilenameUniqDict, url_re, make_refnode, clean_astext + docname_join, FilenameUniqDict, url_re, make_refnode, clean_astext, \ + compile_matchers from sphinx.errors import SphinxError, ExtensionError @@ -416,14 +417,15 @@ class BuildEnvironment: """ Find all source files in the source dir and put them in self.found_docs. """ - exclude_dirs = [d.replace(SEP, path.sep) for d in config.exclude_dirs] - exclude_trees = [d.replace(SEP, path.sep) for d in config.exclude_trees] + matchers = compile_matchers( + config.exclude_patterns[:] + + config.exclude_trees + + [d + config.source_suffix for d in config.unused_docs] + + ['**/' + d for d in config.exclude_dirnames] + + ['**/_sources'] + ) self.found_docs = set(get_matching_docs( - self.srcdir, config.source_suffix, - exclude_docs=set(config.unused_docs), - exclude_dirs=exclude_dirs, - exclude_trees=exclude_trees, - exclude_dirnames=['_sources'] + config.exclude_dirnames)) + self.srcdir, config.source_suffix, exclude_matchers=matchers)) def get_outdated_files(self, config_changed): """ diff --git a/sphinx/quickstart.py b/sphinx/quickstart.py index 51103b5a..faea2c2e 100644 --- a/sphinx/quickstart.py +++ b/sphinx/quickstart.py @@ -84,12 +84,9 @@ release = '%(release_str)s' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%%B %%d, %%Y' -# List of documents that shouldn't be included in the build. -#unused_docs = [] - -# List of directories, relative to source directory, that shouldn't be searched -# for source files. -exclude_trees = [%(exclude_trees)s] +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = [%(exclude_patterns)s] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None @@ -743,10 +740,10 @@ directly.''' mkdir_p(srcdir) if d['sep']: builddir = path.join(d['path'], 'build') - d['exclude_trees'] = '' + d['exclude_patterns'] = '' else: builddir = path.join(srcdir, d['dot'] + 'build') - d['exclude_trees'] = repr(d['dot'] + 'build') + d['exclude_patterns'] = repr(d['dot'] + 'build') mkdir_p(builddir) mkdir_p(path.join(srcdir, d['dot'] + 'templates')) mkdir_p(path.join(srcdir, d['dot'] + 'static')) diff --git a/sphinx/themes/agogo/layout.html b/sphinx/themes/agogo/layout.html index d8b9d57e..73636376 100644 --- a/sphinx/themes/agogo/layout.html +++ b/sphinx/themes/agogo/layout.html @@ -1,3 +1,13 @@ +{# + agogo/layout.html + ~~~~~~~~~~~~~~~~~ + + Sphinx layout template for the agogo theme, originally written + by Andi Albrecht. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "basic/layout.html" %} {% block header %} diff --git a/sphinx/themes/agogo/static/agogo.css_t b/sphinx/themes/agogo/static/agogo.css_t index ab257f56..4dd03d92 100644 --- a/sphinx/themes/agogo/static/agogo.css_t +++ b/sphinx/themes/agogo/static/agogo.css_t @@ -1,3 +1,14 @@ +/* + * agogo.css_t + * ~~~~~~~~~~~ + * + * Sphinx stylesheet -- agogo theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + * { margin: 0px; padding: 0px; diff --git a/sphinx/themes/basic/defindex.html b/sphinx/themes/basic/defindex.html index 40f4f4c9..f337faec 100644 --- a/sphinx/themes/basic/defindex.html +++ b/sphinx/themes/basic/defindex.html @@ -1,3 +1,12 @@ +{# + basic/defindex.html + ~~~~~~~~~~~~~~~~~~~ + + Default template for the "index" page. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% set title = _('Overview') %} {% block body %} diff --git a/sphinx/themes/basic/genindex-single.html b/sphinx/themes/basic/genindex-single.html index 9aaaeb0c..1e98ba9c 100644 --- a/sphinx/themes/basic/genindex-single.html +++ b/sphinx/themes/basic/genindex-single.html @@ -1,36 +1,38 @@ +{# + basic/genindex-single.html + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + + Template for a "single" page of a split index. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% set title = _('Index') %} {% block body %} <h1 id="index">{% trans key=key %}Index – {{ key }}{% endtrans %}</h1> -<table width="100%" class="indextable"><tr><td width="33%" valign="top"> -<dl> -{%- set breakat = count // 2 %} -{%- set numcols = 1 %} -{%- set numitems = 0 %} -{% for entryname, (links, subitems) in entries %} -<dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a> - {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} - {%- else -%} -{{ entryname|e }} - {%- endif -%}</dt> - {%- if subitems %} - <dd><dl> +<table width="100%" class="indextable"><tr> + {%- for column in entries|slice(2) if column %} + <td width="33%" valign="top"><dl> + {%- for entryname, (links, subitems) in column %} + <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a> + {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %} + {%- else %}{{ entryname|e }}{% endif %}</dt> + {%- if subitems %} + <dd><dl> {%- for subentryname, subentrylinks in subitems %} - <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> - {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} - </dt> + <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> + {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} + </dt> {%- endfor %} </dl></dd> {%- endif -%} -{%- set numitems = numitems + 1 + (subitems|length) -%} -{%- if numcols < 2 and numitems > breakat -%} -{%- set numcols = numcols+1 -%} -</dl></td><td width="33%" valign="top"><dl> -{%- endif -%} {%- endfor %} -</dl></td></tr></table> +</dl></td> +{%- endfor %} +</tr></table> {% endblock %} diff --git a/sphinx/themes/basic/genindex-split.html b/sphinx/themes/basic/genindex-split.html index ab099e5b..d068a96a 100644 --- a/sphinx/themes/basic/genindex-split.html +++ b/sphinx/themes/basic/genindex-split.html @@ -1,3 +1,12 @@ +{# + basic/genindex-split.html + ~~~~~~~~~~~~~~~~~~~~~~~~~ + + Template for a "split" index overview page. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% set title = _('Index') %} {% block body %} @@ -6,6 +15,7 @@ <p>{{ _('Index pages by letter') }}:</p> + <div class="genindex-jumpbox"> <p>{% for key, dummy in genindexentries -%} <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a> {% if not loop.last %}| {% endif %} @@ -13,6 +23,7 @@ <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong> ({{ _('can be huge') }})</a></p> + </div> {% endblock %} diff --git a/sphinx/themes/basic/genindex.html b/sphinx/themes/basic/genindex.html index a19aa80f..4d46380f 100644 --- a/sphinx/themes/basic/genindex.html +++ b/sphinx/themes/basic/genindex.html @@ -1,44 +1,46 @@ +{# + basic/genindex.html + ~~~~~~~~~~~~~~~~~~~ + + Template for an "all-in-one" index. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% set title = _('Index') %} {% block body %} <h1 id="index">{{ _('Index') }}</h1> + <div class="genindex-jumpbox"> {% for key, dummy in genindexentries -%} <a href="#{{ key }}"><strong>{{ key }}</strong></a> {% if not loop.last %}| {% endif %} {%- endfor %} + </div> - <hr /> - - {% for key, entries in genindexentries %} + {%- for key, entries in genindexentries %} <h2 id="{{ key }}">{{ key }}</h2> -<table width="100%" class="indextable"><tr><td width="33%" valign="top"> -<dl> -{%- set breakat = genindexcounts[loop.index0] // 2 %} -{%- set numcols = 1 %} -{%- set numitems = 0 %} -{% for entryname, (links, subitems) in entries %} -<dt>{%- if links -%}<a href="{{ links[0] }}">{{ entryname|e }}</a> - {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} - {%- else -%} -{{ entryname|e }} - {%- endif -%}</dt> - {%- if subitems %} - <dd><dl> +<table width="100%" class="indextable genindextable"><tr> + {%- for column in entries|slice(2) if column %} + <td width="33%" valign="top"><dl> + {%- for entryname, (links, subitems) in column %} + <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a> + {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %} + {%- else %}{{ entryname|e }}{% endif %}</dt> + {%- if subitems %} + <dd><dl> {%- for subentryname, subentrylinks in subitems %} - <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> - {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} - </dt> + <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> + {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} + </dt> {%- endfor %} </dl></dd> {%- endif -%} -{%- set numitems = numitems + 1 + (subitems|length) -%} -{%- if numcols < 2 and numitems > breakat -%} -{%- set numcols = numcols+1 -%} -</dl></td><td width="33%" valign="top"><dl> -{%- endif -%} {%- endfor %} -</dl></td></tr></table> +</dl></td> +{%- endfor %} +</tr></table> {% endfor %} {% endblock %} diff --git a/sphinx/themes/basic/globaltoc.html b/sphinx/themes/basic/globaltoc.html new file mode 100644 index 00000000..472af34f --- /dev/null +++ b/sphinx/themes/basic/globaltoc.html @@ -0,0 +1,15 @@ +{# + basic/globaltoc.html + ~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: global table of contents. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- block sidebartoc %} +{%- if display_toc %} + <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> + {{ toctree() }} +{%- endif %} +{%- endblock %} diff --git a/sphinx/themes/basic/layout.html b/sphinx/themes/basic/layout.html index c012116c..97b68f8a 100644 --- a/sphinx/themes/basic/layout.html +++ b/sphinx/themes/basic/layout.html @@ -1,3 +1,12 @@ +{# + basic/layout.html + ~~~~~~~~~~~~~~~~~ + + Master layout template for Sphinx themes. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {%- block doctype -%} <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> @@ -37,53 +46,9 @@ </a></p> {%- endif %} {%- endblock %} - {%- block sidebartoc %} - {%- if display_toc %} - <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> - {{ toc }} - {%- endif %} - {%- endblock %} - {%- block sidebarrel %} - {%- if prev %} - <h4>{{ _('Previous topic') }}</h4> - <p class="topless"><a href="{{ prev.link|e }}" - title="{{ _('previous chapter') }}">{{ prev.title }}</a></p> - {%- endif %} - {%- if next %} - <h4>{{ _('Next topic') }}</h4> - <p class="topless"><a href="{{ next.link|e }}" - title="{{ _('next chapter') }}">{{ next.title }}</a></p> - {%- endif %} - {%- endblock %} - {%- block sidebarsourcelink %} - {%- if show_source and has_source and sourcename %} - <h3>{{ _('This Page') }}</h3> - <ul class="this-page-menu"> - <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" - rel="nofollow">{{ _('Show Source') }}</a></li> - </ul> - {%- endif %} - {%- endblock %} - {%- if customsidebar %} - {% include customsidebar %} - {%- endif %} - {%- block sidebarsearch %} - {%- if pagename != "search" %} - <div id="searchbox" style="display: none"> - <h3>{{ _('Quick search') }}</h3> - <form class="search" action="{{ pathto('search') }}" method="get"> - <input type="text" name="q" size="18" /> - <input type="submit" value="{{ _('Go') }}" /> - <input type="hidden" name="check_keywords" value="yes" /> - <input type="hidden" name="area" value="default" /> - </form> - <p class="searchtip" style="font-size: 90%"> - {{ _('Enter search terms or a module, class or function name.') }} - </p> - </div> - <script type="text/javascript">$('#searchbox').show(0);</script> - {%- endif %} - {%- endblock %} + {%- for sidebar in sidebars %} + {%- include sidebar %} + {%- endfor %} </div> </div> {%- endif %}{% endif %} diff --git a/sphinx/themes/basic/localtoc.html b/sphinx/themes/basic/localtoc.html new file mode 100644 index 00000000..dab70cd8 --- /dev/null +++ b/sphinx/themes/basic/localtoc.html @@ -0,0 +1,15 @@ +{# + basic/localtoc.html + ~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: local table of contents. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- block sidebartoc %} +{%- if display_toc %} + <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> + {{ toc }} +{%- endif %} +{%- endblock %} diff --git a/sphinx/themes/basic/modindex.html b/sphinx/themes/basic/modindex.html index 0392edc8..96f8ac43 100644 --- a/sphinx/themes/basic/modindex.html +++ b/sphinx/themes/basic/modindex.html @@ -1,3 +1,12 @@ +{# + basic/modindex.html + ~~~~~~~~~~~~~~~~~~~ + + Template for the module index. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% set title = _('Global Module Index') %} {% block extrahead %} @@ -12,12 +21,13 @@ <h1 id="global-module-index">{{ _('Global Module Index') }}</h1> + <div class="modindex-jumpbox"> {%- for letter in letters %} <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a> {% if not loop.last %}| {% endif %} {%- endfor %} - <hr/> + </div> - <table width="100%" class="indextable" cellspacing="0" cellpadding="2"> + <table class="indextable modindextable" cellspacing="0" cellpadding="2"> {%- for modname, collapse, cgroup, indent, fname, synops, pform, dep, stripped in modindexentries %} {%- if not modname -%} <tr class="pcap"><td></td><td> </td><td></td></tr> diff --git a/sphinx/themes/basic/page.html b/sphinx/themes/basic/page.html index 17a93016..c7188fa5 100644 --- a/sphinx/themes/basic/page.html +++ b/sphinx/themes/basic/page.html @@ -1,3 +1,12 @@ +{# + basic/page.html + ~~~~~~~~~~~~~~~ + + Master template for simple pages. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% block body %} {{ body }} diff --git a/sphinx/themes/basic/relations.html b/sphinx/themes/basic/relations.html new file mode 100644 index 00000000..18e7cc4c --- /dev/null +++ b/sphinx/themes/basic/relations.html @@ -0,0 +1,21 @@ +{# + basic/relations.html + ~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: relation links. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- block sidebarrel %} +{%- if prev %} + <h4>{{ _('Previous topic') }}</h4> + <p class="topless"><a href="{{ prev.link|e }}" + title="{{ _('previous chapter') }}">{{ prev.title }}</a></p> +{%- endif %} +{%- if next %} + <h4>{{ _('Next topic') }}</h4> + <p class="topless"><a href="{{ next.link|e }}" + title="{{ _('next chapter') }}">{{ next.title }}</a></p> +{%- endif %} +{%- endblock %} diff --git a/sphinx/themes/basic/search.html b/sphinx/themes/basic/search.html index 96c40652..eac32605 100644 --- a/sphinx/themes/basic/search.html +++ b/sphinx/themes/basic/search.html @@ -1,3 +1,12 @@ +{# + basic/search.html + ~~~~~~~~~~~~~~~~~ + + Template for the search page. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "layout.html" %} {% set title = _('Search') %} {% set script_files = script_files + ['_static/searchtools.js'] %} diff --git a/sphinx/themes/basic/searchbox.html b/sphinx/themes/basic/searchbox.html new file mode 100644 index 00000000..fb5e0889 --- /dev/null +++ b/sphinx/themes/basic/searchbox.html @@ -0,0 +1,26 @@ +{# + basic/searchbox.html + ~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: quick search box. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- block sidebarsearch %} +{%- if pagename != "search" %} +<div id="searchbox" style="display: none"> + <h3>{{ _('Quick search') }}</h3> + <form class="search" action="{{ pathto('search') }}" method="get"> + <input type="text" name="q" size="18" /> + <input type="submit" value="{{ _('Go') }}" /> + <input type="hidden" name="check_keywords" value="yes" /> + <input type="hidden" name="area" value="default" /> + </form> + <p class="searchtip" style="font-size: 90%"> + {{ _('Enter search terms or a module, class or function name.') }} + </p> +</div> +<script type="text/javascript">$('#searchbox').show(0);</script> +{%- endif %} +{%- endblock %} diff --git a/sphinx/themes/basic/sourcelink.html b/sphinx/themes/basic/sourcelink.html new file mode 100644 index 00000000..665e1272 --- /dev/null +++ b/sphinx/themes/basic/sourcelink.html @@ -0,0 +1,18 @@ +{# + basic/sourcelink.html + ~~~~~~~~~~~~~~~~~~~~~ + + Sphinx sidebar template: "show source" link. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{%- block sidebarsourcelink %} +{%- if show_source and has_source and sourcename %} + <h3>{{ _('This Page') }}</h3> + <ul class="this-page-menu"> + <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" + rel="nofollow">{{ _('Show Source') }}</a></li> + </ul> +{%- endif %} +{%- endblock %} diff --git a/sphinx/themes/basic/static/basic.css b/sphinx/themes/basic/static/basic.css index 344c81cd..bd0a8544 100644 --- a/sphinx/themes/basic/static/basic.css +++ b/sphinx/themes/basic/static/basic.css @@ -1,6 +1,12 @@ -/** - * Sphinx stylesheet -- basic theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* + * basic.css + * ~~~~~~~~~ + * + * Sphinx stylesheet -- basic theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * */ /* -- main layout ----------------------------------------------------------- */ @@ -127,6 +133,10 @@ span.linkdescr { /* -- general index --------------------------------------------------------- */ +table.indextable { + width: 100%; +} + table.indextable td { text-align: left; vertical-align: top; @@ -152,6 +162,20 @@ img.toggler { cursor: pointer; } +div.modindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + +div.genindex-jumpbox { + border-top: 1px solid #ddd; + border-bottom: 1px solid #ddd; + margin: 1em 0 1em 0; + padding: 0.4em; +} + /* -- general body styles --------------------------------------------------- */ a.headerlink { diff --git a/sphinx/themes/basic/static/doctools.js b/sphinx/themes/basic/static/doctools.js index 12afe01b..31c780e8 100644 --- a/sphinx/themes/basic/static/doctools.js +++ b/sphinx/themes/basic/static/doctools.js @@ -1,3 +1,14 @@ +/* + * doctools.js + * ~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for all documentation. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + /** * make the code below compatible with browsers without * an installed firebug like debugger diff --git a/sphinx/themes/basic/static/searchtools.js b/sphinx/themes/basic/static/searchtools.js index 2dbda10e..6b0000e8 100644 --- a/sphinx/themes/basic/static/searchtools.js +++ b/sphinx/themes/basic/static/searchtools.js @@ -1,3 +1,14 @@ +/* + * searchtools.js + * ~~~~~~~~~~~~~~ + * + * Sphinx JavaScript utilties for the full-text search. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + /** * helper function to return a node containing the * search summary for a given text. keywords is a list diff --git a/sphinx/themes/default/static/default.css_t b/sphinx/themes/default/static/default.css_t index cd1db7ec..04562d96 100644 --- a/sphinx/themes/default/static/default.css_t +++ b/sphinx/themes/default/static/default.css_t @@ -1,6 +1,12 @@ -/** - * Sphinx stylesheet -- default theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* + * default.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- default theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * */ @import url("basic.css"); diff --git a/sphinx/themes/epub/layout.html b/sphinx/themes/epub/layout.html index 64b1a4cb..8a348bed 100644 --- a/sphinx/themes/epub/layout.html +++ b/sphinx/themes/epub/layout.html @@ -1,3 +1,12 @@ +{# + epub/layout.html + ~~~~~~~~~~~~~~~~ + + Sphinx layout template for the epub theme. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "basic/layout.html" %} {# add only basic navigation links #} diff --git a/sphinx/themes/epub/static/epub.css b/sphinx/themes/epub/static/epub.css index 72b77190..f941b79a 100644 --- a/sphinx/themes/epub/static/epub.css +++ b/sphinx/themes/epub/static/epub.css @@ -1,6 +1,12 @@ -/** - * Sphinx stylesheet -- epub theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* + * epub.css_t + * ~~~~~~~~~~ + * + * Sphinx stylesheet -- epub theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * */ /* -- main layout ----------------------------------------------------------- */ diff --git a/sphinx/themes/haiku/layout.html b/sphinx/themes/haiku/layout.html new file mode 100644 index 00000000..91c76852 --- /dev/null +++ b/sphinx/themes/haiku/layout.html @@ -0,0 +1,68 @@ +{# + haiku/layout.html + ~~~~~~~~~~~~~~~~~ + + Sphinx layout template for the haiku theme. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{% extends "basic/layout.html" %} +{% set script_files = script_files + ['_static/theme_extras.js'] %} +{% set css_files = css_files + ['_static/print.css'] %} + +{# do not display relbars #} +{% block relbar1 %}{% endblock %} +{% block relbar2 %}{% endblock %} + +{% macro nav() %} + <p> + {%- block haikurel1 %} + {%- endblock %} + {%- if prev %} + «  <a href="{{ prev.link|e }}">{{ prev.title }}</a> +   ::   + {%- endif %} + <a class="uplink" href="{{ pathto(master_doc) }}">{{ _('Contents') }}</a> + {%- if next %} +   ::   + <a href="{{ next.link|e }}">{{ next.title }}</a>  » + {%- endif %} + {%- block haikurel2 %} + {%- endblock %} + </p> +{% endmacro %} + +{% block content %} + <div class="header"> + {%- block haikuheader %} + {%- if theme_full_logo != "false" %} + <a href="{{ pathto('index') }}"> + <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> + </a> + {%- else %} + {%- if logo -%} + <img class="rightlogo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> + {%- endif -%} + <h1 class="heading"><a href="{{ pathto('index') }}"> + <span>{{ shorttitle|e }}</span></a></h1> + <h2 class="heading"><span>{{ title|striptags }}</span></h2> + {%- endif %} + {%- endblock %} + </div> + <div class="topnav"> + {{ nav() }} + </div> + <div class="content"> + {#{%- if display_toc %} + <div id="toc"> + <h3>Table Of Contents</h3> + {{ toc }} + </div> + {%- endif %}#} + {% block body %}{% endblock %} + </div> + <div class="bottomnav"> + {{ nav() }} + </div> +{% endblock %}
\ No newline at end of file diff --git a/sphinx/themes/haiku/static/alert_info_32.png b/sphinx/themes/haiku/static/alert_info_32.png Binary files differnew file mode 100644 index 00000000..05b4fe89 --- /dev/null +++ b/sphinx/themes/haiku/static/alert_info_32.png diff --git a/sphinx/themes/haiku/static/alert_warning_32.png b/sphinx/themes/haiku/static/alert_warning_32.png Binary files differnew file mode 100644 index 00000000..f13611cd --- /dev/null +++ b/sphinx/themes/haiku/static/alert_warning_32.png diff --git a/sphinx/themes/haiku/static/bg-page.png b/sphinx/themes/haiku/static/bg-page.png Binary files differnew file mode 100644 index 00000000..c6f3bc47 --- /dev/null +++ b/sphinx/themes/haiku/static/bg-page.png diff --git a/sphinx/themes/haiku/static/bullet_orange.png b/sphinx/themes/haiku/static/bullet_orange.png Binary files differnew file mode 100644 index 00000000..ad5d02f3 --- /dev/null +++ b/sphinx/themes/haiku/static/bullet_orange.png diff --git a/sphinx/themes/haiku/static/haiku.css_t b/sphinx/themes/haiku/static/haiku.css_t new file mode 100644 index 00000000..7adfb0f3 --- /dev/null +++ b/sphinx/themes/haiku/static/haiku.css_t @@ -0,0 +1,359 @@ +/* + * haiku.css_t + * ~~~~~~~~~~~ + * + * Sphinx stylesheet -- haiku theme. + * + * Adapted from http://haiku-os.org/docs/Haiku-doc.css. + * Original copyright message: + * + * Copyright 2008-2009, Haiku. All rights reserved. + * Distributed under the terms of the MIT License. + * + * Authors: + * Francois Revol <revol@free.fr> + * Stephan Assmus <superstippi@gmx.de> + * Braden Ewing <brewin@gmail.com> + * Humdinger <humdingerb@gmail.com> + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + +@import url("basic.css"); + +html { + margin: 0px; + padding: 0px; + background: #FFF url(bg-page.png) top left repeat-x; +} + +body { + line-height: 1.5; + margin: auto; + padding: 0px; + font-family: "DejaVu Sans", Arial, Helvetica, sans-serif; + min-width: 59em; + max-width: 70em; + color: {{ theme_textcolor }}; +} + +div.footer { + padding: 8px; + font-size: 11px; + text-align: center; + letter-spacing: 0.5px; +} + +/* link colors and text decoration */ + +a:link { + font-weight: bold; + text-decoration: none; + color: {{ theme_linkcolor }}; +} + +a:visited { + font-weight: bold; + text-decoration: none; + color: {{ theme_visitedlinkcolor }}; +} + +a:hover, a:active { + text-decoration: underline; + color: {{ theme_hoverlinkcolor }}; +} + +/* Some headers act as anchors, don't give them a hover effect */ + +h1 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +h2 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +h3 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +h4 a:hover, a:active { + text-decoration: none; + color: {{ theme_headingcolor }}; +} + +a.headerlink { + color: #a7ce38; + padding-left: 5px; +} + +a.headerlink:hover { + color: #a7ce38; +} + +/* basic text elements */ + +div.content { + margin-top: 20px; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 50px; + font-size: 0.9em; +} + +/* heading and navigation */ + +div.header { + position: relative; + left: 0px; + top: 0px; + height: 85px; + /* background: #eeeeee; */ + padding: 0 40px; +} +div.header h1 { + font-size: 1.6em; + font-weight: normal; + letter-spacing: 1px; + color: {{ theme_headingcolor }}; + border: 0; + margin: 0; + padding-top: 15px; +} +div.header h1 a { + font-weight: normal; + color: {{ theme_headingcolor }}; +} +div.header h2 { + font-size: 1.3em; + font-weight: normal; + letter-spacing: 1px; + text-transform: uppercase; + color: #aaa; + border: 0; + margin-top: -3px; + padding: 0; +} + +div.header img.rightlogo { + float: right; +} + + +div.title { + font-size: 1.3em; + font-weight: bold; + color: {{ theme_headingcolor }}; + border-bottom: dotted thin #e0e0e0; + margin-bottom: 25px; +} +div.topnav { + /* background: #e0e0e0; */ +} +div.topnav p { + margin-top: 0; + margin-left: 40px; + margin-right: 40px; + margin-bottom: 0px; + text-align: right; + font-size: 0.8em; +} +div.bottomnav { + background: #eeeeee; +} +div.bottomnav p { + margin-right: 40px; + text-align: right; + font-size: 0.8em; +} + +a.uplink { + font-weight: normal; +} + + +/* contents box */ + +table.index { + margin: 0px 0px 30px 30px; + padding: 1px; + border-width: 1px; + border-style: dotted; + border-color: #e0e0e0; +} +table.index tr.heading { + background-color: #e0e0e0; + text-align: center; + font-weight: bold; + font-size: 1.1em; +} +table.index tr.index { + background-color: #eeeeee; +} +table.index td { + padding: 5px 20px; +} + +table.index a:link, table.index a:visited { + font-weight: normal; + text-decoration: none; + color: {{ theme_linkcolor }}; +} +table.index a:hover, table.index a:active { + text-decoration: underline; + color: {{ theme_hoverlinkcolor }}; +} + + +/* Haiku User Guide styles and layout */ + +/* Rounded corner boxes */ +/* Common declarations */ +div.admonition { + -webkit-border-radius: 10px; + -khtml-border-radius: 10px; + -moz-border-radius: 10px; + border-radius: 10px; + border-style: dotted; + border-width: thin; + border-color: #dcdcdc; + padding: 10px 15px 10px 15px; + margin-bottom: 15px; + margin-top: 15px; +} +div.note { + padding: 10px 15px 10px 80px; + background: #e4ffde url(alert_info_32.png) 15px 15px no-repeat; + min-height: 42px; +} +div.warning { + padding: 10px 15px 10px 80px; + background: #fffbc6 url(alert_warning_32.png) 15px 15px no-repeat; + min-height: 42px; +} +div.seealso { + background: #e4ffde; +} + +/* More layout and styles */ +h1 { + font-size: 1.3em; + font-weight: bold; + color: {{ theme_headingcolor }}; + border-bottom: dotted thin #e0e0e0; + margin-top: 30px; +} + +h2 { + font-size: 1.2em; + font-weight: normal; + color: {{ theme_headingcolor }}; + border-bottom: dotted thin #e0e0e0; + margin-top: 30px; +} + +h3 { + font-size: 1.1em; + font-weight: normal; + color: {{ theme_headingcolor }}; + margin-top: 30px; +} + +h4 { + font-size: 1.0em; + font-weight: normal; + color: {{ theme_headingcolor }}; + margin-top: 30px; +} + +p { + text-align: justify; +} + +p.last { + margin-bottom: 0; +} + +ol { + padding-left: 20px; +} + +ul { + padding-left: 5px; + margin-top: 3px; +} + +li { + line-height: 1.3; +} + +div.content li { + -moz-background-clip:border; + -moz-background-inline-policy:continuous; + -moz-background-origin:padding; + background: transparent url(bullet_orange.png) no-repeat scroll left 0.45em; + list-style-image: none; + list-style-type: none; + padding: 0 0 0 1.666em; + margin-bottom: 3px; +} + +td { + vertical-align: top; +} + +tt { + background-color: #e2e2e2; + font-size: 1.0em; + font-family: monospace; +} + +pre { + border-color: #0c3762; + border-style: dotted; + border-width: thin; + margin: 0 0 12px 0; + padding: 0.8em; + background-color: #f0f0f0; +} + +hr { + border-top: 1px solid #ccc; + border-bottom: 0; + border-right: 0; + border-left: 0; + margin-bottom: 10px; + margin-top: 20px; +} + +/* printer only pretty stuff */ +@media print { + .noprint { + display: none; + } + /* for acronyms we want their definitions inlined at print time */ + acronym[title]:after { + font-size: small; + content: " (" attr(title) ")"; + font-style: italic; + } + /* and not have mozilla dotted underline */ + acronym { + border: none; + } + div.topnav, div.bottomnav, div.header, table.index { + display: none; + } + div.content { + margin: 0px; + padding: 0px; + } + html { + background: #FFF; + } +} diff --git a/sphinx/themes/haiku/theme.conf b/sphinx/themes/haiku/theme.conf new file mode 100644 index 00000000..3537da1d --- /dev/null +++ b/sphinx/themes/haiku/theme.conf @@ -0,0 +1,12 @@ +[theme] +inherit = basic +stylesheet = haiku.css +pygments_style = autumn + +[options] +full_logo = false +textcolor = #333333 +headingcolor = #0c3762 +linkcolor = #dc3c01 +visitedlinkcolor = #892601 +hoverlinkcolor = #ff4500 diff --git a/sphinx/themes/nature/static/nature.css_t b/sphinx/themes/nature/static/nature.css_t index 31d9ec62..5991e349 100644 --- a/sphinx/themes/nature/static/nature.css_t +++ b/sphinx/themes/nature/static/nature.css_t @@ -1,6 +1,12 @@ -/** - * Sphinx stylesheet -- nature theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* + * nature.css_t + * ~~~~~~~~~~~~ + * + * Sphinx stylesheet -- nature theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * */ @import url("basic.css"); diff --git a/sphinx/themes/scrolls/genindex.html b/sphinx/themes/scrolls/genindex.html deleted file mode 100644 index 9add6e95..00000000 --- a/sphinx/themes/scrolls/genindex.html +++ /dev/null @@ -1,36 +0,0 @@ -{% extends "layout.html" %} -{% set title = 'Index' %} -{% block body %} - - <h1 id="index">Index</h1> - - {% for key, dummy in genindexentries -%} - <a href="#{{ key }}"><strong>{{ key }}</strong></a> {% if not loop.last %}| {% endif %} - {%- endfor %} - <hr> - - {% for key, entries in genindexentries %} - <h2 id="{{ key }}">{{ key }}</h2> - <table class="indextable"><tr> - {%- for column in entries|slice(2) if column %} - <td><dl> - {%- for entryname, (links, subitems) in column %} - <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a> - {% for link in links[1:] %}, <a href="{{ link }}">[Link]</a>{% endfor %} - {%- else %}{{ entryname|e }}{% endif %}</dt> - {%- if subitems %} - <dd><dl> - {%- for subentryname, subentrylinks in subitems %} - <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> - {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[Link]</a>{% endfor -%} - </dt> - {%- endfor %} - </dl></dd> - {%- endif -%} - {%- endfor %} - </dl></td> - {%- endfor %} - </tr></table> - {% endfor %} - -{% endblock %} diff --git a/sphinx/themes/scrolls/layout.html b/sphinx/themes/scrolls/layout.html index d1c66ae2..9c139b88 100644 --- a/sphinx/themes/scrolls/layout.html +++ b/sphinx/themes/scrolls/layout.html @@ -1,58 +1,20 @@ -<!doctype html> -<html> - <head> - {%- if not embedded %} - {%- set titlesuffix = " — "|safe + docstitle|e %} - {%- else %} - {%- set titlesuffix = "" %} - {%- endif %} - <title>{{ title|striptags }}{{ titlesuffix }}</title> - <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> - <link rel="stylesheet" href="{{ pathto('_static/style.css', 1) }}" type="text/css"> - <link rel="stylesheet" href="{{ pathto('_static/print.css', 1) }}" type="text/css" media="print"> - <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css"> - {%- if builder != 'htmlhelp' %} - <script type="text/javascript"> - var DOCUMENTATION_OPTIONS = { - URL_ROOT: '{{ pathto("", 1) }}', - VERSION: '{{ release|e }}', - COLLAPSE_MODINDEX: false, - FILE_SUFFIX: '{{ file_suffix }}', - HAS_SOURCE: {{ has_source|lower }} - }; - </script> - <script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script> - <script type="text/javascript" src="{{ pathto('_static/interface.js', 1) }}"></script> - <script type="text/javascript" src="{{ pathto('_static/doctools.js', 1) }}"></script> - <script type="text/javascript" src="{{ pathto('_static/theme_extras.js', 1) }}"></script> - {%- endif %} - {%- if use_opensearch and builder != 'htmlhelp' %} - <link rel="search" type="application/opensearchdescription+xml" - title="Search within {{ docstitle }}" - href="{{ pathto('_static/opensearch.xml', 1) }}"> - {%- endif %} - {%- if hasdoc('about') %} - <link rel="author" title="About these documents" href="{{ pathto('about') }}"> - {%- endif %} - <link rel="contents" title="Global table of contents" href="{{ pathto('contents') }}"> - <link rel="index" title="Global index" href="{{ pathto('genindex') }}"> - <link rel="search" title="Search" href="{{ pathto('search') }}"> - {%- if hasdoc('copyright') %} - <link rel="copyright" title="Copyright" href="{{ pathto('copyright') }}"> - {%- endif %} - <link rel="top" title="{{ docstitle }}" href="{{ pathto('index') }}"> - {%- if parents %} - <link rel="up" title="{{ parents[-1].title|striptags }}" href="{{ parents[-1].link|e }}"> - {%- endif %} - {%- if next %} - <link rel="next" title="{{ next.title|striptags }}" href="{{ next.link|e }}"> - {%- endif %} - {%- if prev %} - <link rel="prev" title="{{ prev.title|striptags }}" href="{{ prev.link|e }}"> - {%- endif %} - {% block extrahead %}{% endblock %} - </head> - <body> +{# + scrolls/layout.html + ~~~~~~~~~~~~~~~~~~~ + + Sphinx layout template for the scrolls theme, originally written + by Armin Ronacher. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} +{% extends "basic/layout.html" %} +{% set script_files = script_files + ['_static/theme_extras.js'] %} +{% set css_files = css_files + ['_static/print.css'] %} +{# do not display relbars #} +{% block relbar1 %}{% endblock %} +{% block relbar2 %}{% endblock %} +{% block content %} <div id="content"> <div class="header"> <h1 class="heading"><a href="{{ pathto('index') }}" @@ -77,20 +39,4 @@ {% block body %}{% endblock %} </div> </div> - <div class="footer"> - {%- if show_copyright %} - {%- if hasdoc('copyright') %} - {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} - {%- else %} - {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} - {%- endif %} - {%- endif %} - {%- if last_updated %} - {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} - {%- endif %} - {%- if show_sphinx %} - {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} - {%- endif %} - </div> - </body> -</html> +{% endblock %}
\ No newline at end of file diff --git a/sphinx/themes/scrolls/modindex.html b/sphinx/themes/scrolls/modindex.html deleted file mode 100644 index 314ebdd9..00000000 --- a/sphinx/themes/scrolls/modindex.html +++ /dev/null @@ -1,43 +0,0 @@ -{% extends "layout.html" %} -{% set title = _('Global Module Index') %} -{% block extrahead %} -{{ super() }} -{% if not embedded and collapse_modindex %} - <script type="text/javascript"> - DOCUMENTATION_OPTIONS.COLLAPSE_MODINDEX = true; - </script> -{% endif %} -{% endblock %} -{% block body %} - - <h1 id="global-module-index">{{ _('Global Module Index') }}</h1> - - <div class="modindex-jumpbox"> - {%- for letter in letters %} - <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a> {% if not loop.last %}| {% endif %} - {%- endfor %} - </div> - - <table class="modindextable"> - {%- for modname, collapse, cgroup, indent, fname, synops, pform, dep, stripped in modindexentries %} - {%- if not modname -%} - <tr class="pcap"><td></td><td> </td><td></td></tr> - <tr class="cap"><td></td><td><a name="cap-{{ fname }}"><strong>{{ fname }}</strong></a></td><td></td></tr> - {%- else -%} - <tr{% if indent %} class="cg-{{ cgroup }}"{% endif %}> - <td>{% if collapse -%} - <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ cgroup }}" - class="toggler" style="display: none" alt="-" /> - {%- endif %}</td> - <td>{% if indent %} {% endif %} - {% if fname %}<a href="{{ fname }}">{% endif -%} - <tt class="xref">{{ stripped|e }}{{ modname|e }}</tt> - {%- if fname %}</a>{% endif %} - {%- if pform and pform[0] %} <em>({{ pform|join(', ') }})</em>{% endif -%} - </td><td>{% if dep %}<strong>{{ _('Deprecated')}}:</strong>{% endif %} - <em>{{ synops|e }}</em></td></tr> - {%- endif -%} - {% endfor %} - </table> - -{% endblock %} diff --git a/sphinx/themes/scrolls/opensearch.xml b/sphinx/themes/scrolls/opensearch.xml deleted file mode 100644 index 9f2fa427..00000000 --- a/sphinx/themes/scrolls/opensearch.xml +++ /dev/null @@ -1,9 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> - <ShortName>{{ project }}</ShortName> - <Description>Search {{ docstitle }}</Description> - <InputEncoding>utf-8</InputEncoding> - <Url type="text/html" method="get" - template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}&check_keywords=yes&area=default"/> - <LongName>{{ docstitle }}</LongName> -</OpenSearchDescription> diff --git a/sphinx/themes/scrolls/page.html b/sphinx/themes/scrolls/page.html deleted file mode 100644 index ee6cad3d..00000000 --- a/sphinx/themes/scrolls/page.html +++ /dev/null @@ -1,4 +0,0 @@ -{% extends 'layout.html' %} -{% block body %} - {{ body }} -{% endblock %} diff --git a/sphinx/themes/scrolls/search.html b/sphinx/themes/scrolls/search.html deleted file mode 100644 index 0c942b70..00000000 --- a/sphinx/themes/scrolls/search.html +++ /dev/null @@ -1,35 +0,0 @@ -{% extends "layout.html" %} -{% set title = 'Search' %} -{% block extrahead %} - <script type="text/javascript" src="{{ pathto('_static/searchtools.js', 1) }}"></script> -{% endblock %} -{% block body %} - <h1 id="search-documentation">Search</h1> - <p> - From here you can search these documents. Enter your search - words into the box below and click "search". Note that the search - function will automatically search for all of the words. Pages - containing less words won't appear in the result list. - </p> - <form action="" method="get"><p> - <input type="text" name="q" value=""> - <input type="submit" value="search"> - </p></form> - {% if search_performed %} - <h2>Search Results</h2> - {% if not search_results %} - <p>Your search did not match any results.</p> - {% endif %} - {% endif %} - <div id="search-results"> - {% if search_results %} - <ul> - {% for href, caption, context in search_results %} - <li><a href="{{ pathto(item.href) }}">{{ caption }}</a> - <div class="context">{{ context|e }}</div> - </li> - {% endfor %} - </ul> - {% endif %} - </div> -{% endblock %} diff --git a/sphinx/themes/scrolls/static/style.css_t b/sphinx/themes/scrolls/static/scrolls.css_t index 00b78aaa..41a725a6 100644 --- a/sphinx/themes/scrolls/static/style.css_t +++ b/sphinx/themes/scrolls/static/scrolls.css_t @@ -1,3 +1,14 @@ +/* + * scrolls.css_t + * ~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- scrolls theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * + */ + body { background-color: #222; margin: 0; @@ -86,13 +97,6 @@ h1.heading span { display: none; } -#jinjalogo { - background-image: url(jinjalogo.png); - background-repeat: no-repeat; - width: 400px; - height: 160px; -} - #contentwrapper { max-width: 680px; padding: 0 18px 20px 18px; @@ -259,7 +263,7 @@ table.indextable { width: 100%; } -table.indextable td { +table.genindextable td { vertical-align: top; width: 50%; } @@ -407,4 +411,4 @@ span.highlight { margin-top: 0; margin-bottom: 0; margin-left: 1.5em; -}
\ No newline at end of file +} diff --git a/sphinx/themes/scrolls/theme.conf b/sphinx/themes/scrolls/theme.conf index b4205046..4e7800f9 100644 --- a/sphinx/themes/scrolls/theme.conf +++ b/sphinx/themes/scrolls/theme.conf @@ -1,5 +1,5 @@ [theme] -inherit = default +inherit = basic stylesheet = scrolls.css pygments_style = tango diff --git a/sphinx/themes/sphinxdoc/layout.html b/sphinx/themes/sphinxdoc/layout.html index 48d2118e..2d653f9f 100644 --- a/sphinx/themes/sphinxdoc/layout.html +++ b/sphinx/themes/sphinxdoc/layout.html @@ -1,3 +1,12 @@ +{# + sphinxdoc/layout.html + ~~~~~~~~~~~~~~~~~~~~~ + + Sphinx layout template for the sphinxdoc theme. + + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + :license: BSD, see LICENSE for details. +#} {% extends "basic/layout.html" %} {# put the sidebar before the body #} diff --git a/sphinx/themes/sphinxdoc/static/sphinxdoc.css b/sphinx/themes/sphinxdoc/static/sphinxdoc.css index 75b2ae0f..3f1e84e5 100644 --- a/sphinx/themes/sphinxdoc/static/sphinxdoc.css +++ b/sphinx/themes/sphinxdoc/static/sphinxdoc.css @@ -1,8 +1,13 @@ -/** - * Sphinx stylesheet -- sphinxdoc theme - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +/* + * sphinxdoc.css_t + * ~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- sphinxdoc theme. Originally created by + * Armin Ronacher for Werkzeug. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. * - * Originally created by Armin Ronacher for Werkzeug, adapted by Georg Brandl. */ @import url("basic.css"); diff --git a/sphinx/themes/traditional/static/traditional.css b/sphinx/themes/traditional/static/traditional.css index 624a3627..022e55ae 100644 --- a/sphinx/themes/traditional/static/traditional.css +++ b/sphinx/themes/traditional/static/traditional.css @@ -1,5 +1,12 @@ -/** - * Sphinx Doc Design -- traditional python.org style +/* + * traditional.css + * ~~~~~~~~~~~~~~~ + * + * Sphinx stylesheet -- traditional docs.python.org theme. + * + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. + * :license: BSD, see LICENSE for details. + * */ body { diff --git a/sphinx/util/__init__.py b/sphinx/util/__init__.py index b7f756fc..248b0ce2 100644 --- a/sphinx/util/__init__.py +++ b/sphinx/util/__init__.py @@ -12,7 +12,6 @@ import os import re import sys -import stat import time import errno import types @@ -25,6 +24,7 @@ from os import path import docutils from docutils import nodes +from docutils.utils import relative_path import sphinx @@ -103,38 +103,45 @@ def walk(top, topdown=True, followlinks=False): yield top, dirs, nondirs -def get_matching_docs(dirname, suffix, exclude_docs=(), exclude_dirs=(), - exclude_trees=(), exclude_dirnames=()): +def get_matching_files(dirname, exclude_matchers=()): """ - Get all file names (without suffix) matching a suffix in a - directory, recursively. + Get all file names in a directory, recursively. - Exclude docs in *exclude_docs*, exclude dirs in *exclude_dirs*, - prune dirs in *exclude_trees*, prune dirnames in *exclude_dirnames*. + Exclude files and dirs matching some matcher in *exclude_matchers*. """ - pattern = '*' + suffix # dirname is a normalized absolute path. dirname = path.normpath(path.abspath(dirname)) - dirlen = len(dirname) + 1 # exclude slash + dirlen = len(dirname) + 1 # exclude final os.path.sep + for root, dirs, files in walk(dirname, followlinks=True): - if root[dirlen:] in exclude_dirs: - continue - if root[dirlen:] in exclude_trees: - del dirs[:] + relativeroot = root[dirlen:] + + qdirs = enumerate(path.join(relativeroot, dn).replace(os.path.sep, SEP) + for dn in dirs) + qfiles = enumerate(path.join(relativeroot, fn).replace(os.path.sep, SEP) + for fn in files) + for matcher in exclude_matchers: + qdirs = [entry for entry in qdirs if not matcher(entry[1])] + qfiles = [entry for entry in qfiles if not matcher(entry[1])] + + dirs[:] = sorted(dirs[i] for (i, _) in qdirs) + + for i, filename in sorted(qfiles): + yield filename + + +def get_matching_docs(dirname, suffix, exclude_matchers=()): + """ + Get all file names (without suffix) matching a suffix in a + directory, recursively. + + Exclude files and dirs matching a pattern in *exclude_patterns*. + """ + suffixpattern = '*' + suffix + for filename in get_matching_files(dirname, exclude_matchers): + if not fnmatch.fnmatch(filename, suffixpattern): continue - dirs.sort() - files.sort() - for prunedir in exclude_dirnames: - if prunedir in dirs: - dirs.remove(prunedir) - for sfile in files: - if not fnmatch.fnmatch(sfile, pattern): - continue - qualified_name = path.join(root[dirlen:], sfile[:-len(suffix)]) - qualified_name = qualified_name.replace(os.path.sep, SEP) - if qualified_name in exclude_docs: - continue - yield qualified_name + yield filename[:-len(suffix)] def mtimes_of_files(dirnames, suffix): @@ -272,9 +279,20 @@ def _translate_pattern(pat): res += re.escape(c) return res + '$' +def compile_matchers(patterns): + return [re.compile(_translate_pattern(pat)).match for pat in patterns] + _pat_cache = {} +def patmatch(name, pat): + """ + Return if name matches pat. Adapted from fnmatch module. + """ + if pat not in _pat_cache: + _pat_cache[pat] = re.compile(_translate_pattern(pat)) + return _pat_cache[pat].match(name) + def patfilter(names, pat): """ Return the subset of the list NAMES that match PAT. @@ -424,9 +442,16 @@ def copyfile(source, dest): pass -def copy_static_entry(source, target, builder, context={}): +def copy_static_entry(source, targetdir, builder, context={}, + exclude_matchers=(), level=0): + if exclude_matchers: + relpath = relative_path(builder.srcdir, source) + for matcher in exclude_matchers: + if matcher(relpath): + return if path.isfile(source): - if source.lower().endswith('_t'): + target = path.join(targetdir, path.basename(source)) + if source.lower().endswith('_t') and builder.templates: # templated! fsrc = open(source, 'rb') fdst = open(target[:-2], 'wb') @@ -436,11 +461,18 @@ def copy_static_entry(source, target, builder, context={}): else: copyfile(source, target) elif path.isdir(source): - if source in builder.config.exclude_dirnames: - return - if path.exists(target): - shutil.rmtree(target) - shutil.copytree(source, target) + if level == 0: + for entry in os.listdir(source): + if entry.startswith('.'): + continue + copy_static_entry(path.join(source, entry), targetdir, + builder, context, level=1, + exclude_matchers=exclude_matchers) + else: + target = path.join(targetdir, path.basename(source)) + if path.exists(target): + shutil.rmtree(target) + shutil.copytree(source, target) def clean_astext(node): @@ -473,6 +505,16 @@ def make_refnode(builder, fromdocname, todocname, targetid, child, title=None): return node +try: + any = any +except NameError: + def any(gen): + for i in gen: + if i: + return True + return False + + # monkey-patch Node.traverse to get more speed # traverse() is called so many times during a build that it saves # on average 20-25% overall build time! |
