Customize user manual templates

This commit is contained in:
Kovid Goyal 2008-03-26 00:34:48 +00:00
parent bd1daa67a7
commit 00f29406ce
5 changed files with 192 additions and 3 deletions

View File

@ -27,7 +27,7 @@ import custom
extensions = ['sphinx.ext.autodoc', 'custom']
# Add any paths that contain templates here, relative to this directory.
templates_path = ['.templates']
templates_path = ['templates']
# The suffix of source filenames.
source_suffix = '.rst'
@ -83,7 +83,7 @@ html_style = 'default.css'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
#html_static_path = ['static']
html_static_path = ['resources']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.

View File

@ -25,9 +25,9 @@ Sections
gui
news
cli/cli-index
conversion
metadata
cli/cli-index
faq
glossary

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

View File

@ -0,0 +1,134 @@
{%- include "macros.html" %}
{%- block doctype -%}
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
{%- endblock %}
{%- macro relbar %}
{# this macro needs to stay in layout.html due to it containing blocks #}
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px"><a href="{{ pathto('genindex') }}" title="General Index" accesskey="I">index</a></li>
{%- if use_modindex %}
<li class="right"><a href="{{ pathto('modindex') }}" title="Global Module Index" accesskey="M">modules</a> |</li>
{%- endif %}
{%- if next %}
<li class="right"><a href="{{ next.link|e }}" title="{{ next.title|striptags }}" accesskey="N">next</a> |</li>
{%- endif %}
{%- if prev %}
<li class="right"><a href="{{ prev.link|e }}" title="{{ prev.title|striptags }}" accesskey="P">previous</a> |</li>
{%- endif %}
{%- if builder == 'web' %}
<li class="right"><a href="{{ pathto('settings') }}"
title="Customize your viewing settings" accesskey="S">settings</a> |</li>
{%- endif %}
{%- block rootrellink %}
<li><a href="{{ pathto('index') }}">{{ project }} v{{ release }} User Manual</a> &raquo;</li>
{%- endblock %}
{%- for parent in parents %}
<li><a href="{{ parent.link|e }}" accesskey="U">{{ parent.title }}</a> &raquo;</li>
{%- endfor %}
{%- block relbaritems %}{% endblock %}
</ul>
</div>
{%- endmacro %}
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
{%- if builder != 'htmlhelp' %}
{%- set titlesuffix = " &mdash; " + project + " Documentation" %}
{%- endif %}
<title>{{ title|striptags }}{{ titlesuffix }}</title>
{%- if builder == 'web' %}
<link rel="stylesheet" href="{{ pathto('index') }}?do=stylesheet{%
if in_admin_panel %}&admin=yes{% endif %}" type="text/css">
{%- for link, type, title in page_links %}
<link rel="alternate" type="{{ type|e(true) }}" title="{{ title|e(true) }}" href="{{ link|e(true) }}">
{%- endfor %}
{%- else %}
<link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css">
<link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css">
{%- endif %}
{%- if builder != 'htmlhelp' %}
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: '{{ pathto("", 1) }}',
VERSION: '{{ release }}'
};
</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>
{%- endif %}
{%- block rellinks %}
{%- 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="{{ project }} Documentation" 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 %}
{%- endblock %}
{%- block extrahead %}{% endblock %}
</head>
<body>
{%- block beforerelbar %}{% endblock %}
{%- block relbar1 %}{{ relbar() }}{% endblock %}
{%- block afterrelbar %}{% endblock %}
{%- block beforesidebar1 %}{% endblock %}
{%- block sidebar1 %}{# possible location for sidebar #}{% endblock %}
{%- block aftersidebar1 %}{% endblock %}
{%- block beforedocument %}{% endblock %}
<div class="document">
<div class="documentwrapper">
{%- if builder != 'htmlhelp' %}
<div class="bodywrapper">
{%- endif %}
<div class="body">
{% block body %}{% endblock %}
</div>
{%- if builder != 'htmlhelp' %}
</div>
{%- endif %}
</div>
{%- block afterdocument %}{% endblock %}
{%- block beforesidebar2 %}{% endblock %}
{%- block sidebar2 %}{{ sidebar() }}{% endblock %}
{%- block aftersidebar2 %}{% endblock %}
<div class="clearer"></div>
</div>
{%- block relbar2 %}{{ relbar() }}{% endblock %}
{%- block beforefooter %}{% endblock %}
{%- block footer %}
<div class="footer">
{%- if hasdoc('copyright') %}
&copy; <a href="{{ pathto('copyright') }}">Copyright</a> {{ copyright }}.
{%- else %}
&copy; Copyright {{ copyright }}.
{%- endif %}
{%- if last_updated %}
Last updated on {{ last_updated }}.
{%- endif %}
</div>
{%- endblock %}
{%- block afterfooter %}{% endblock %}
</body>
</html>

View File

@ -0,0 +1,55 @@
{%- macro sidebar %}
{%- if builder != 'htmlhelp' %}
<div class="sidebar">
<div class="sidebarwrapper">
{% if display_toc %}
<h3>Table Of Contents</h3>
{{ toc }}
{% endif %}
{%- 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 %}
{% if sourcename %}
<h3>This Page</h3>
<ul class="this-page-menu">
{% if builder == 'web' %}
<li><a href="#comments">Comments ({{ comments|length }} so far)</a></li>
<li><a href="{{ pathto('@edit/' + sourcename)|e }}">Suggest Change</a></li>
<li><a href="{{ pathto('@source/' + sourcename)|e }}">Show Source</a></li>
{% elif builder == 'html' %}
<li><a href="{{ pathto('_sources/' + sourcename, true)|e }}">Show Source</a></li>
{% endif %}
</ul>
{% endif %}
{% if customsidebar %}
{{ rendertemplate(customsidebar) }}
{% endif %}
{% if current_page_name != "search" %}
<h3>{{ builder == 'web' and 'Keyword' or '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>
{% if builder == 'web' %}
<p style="font-size: 90%">Enter a module, class or function name.</p>
{% endif %}
{% endif %}
<div style="text-align: center; font: x-large monospace bold; color:yellow">
<style type="text/css">
a.app:hover { text-decoration: none; color: red; }
</style>
<a href="http://{{ project }}.kovidgoyal.net" class="app">
<img alt="logo" src="_static/logo.png" /><br />{{ project }}
</a>
</div>
</div>
</div>
{%- endif %}
{%- endmacro %}