Update User Manual to use the alabaster sphinx theme

This commit is contained in:
Kovid Goyal 2017-05-04 21:59:24 +05:30
parent 7fbd6ecd82
commit ea91d66152
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
11 changed files with 159 additions and 64 deletions

View File

@ -110,11 +110,23 @@ pygments_style = 'sphinx'
# The style sheet to use for HTML and HTML Help pages. A file of that name
# must exist either in Sphinx' static/ path, or in one of the custom paths
# given in html_static_path.
html_theme = 'default'
html_theme_options = {'stickysidebar':'true', 'relbarbgcolor':'black'}
# Put the quick search box on top
html_theme = 'alabaster'
html_sidebars = {
'**' : ['searchbox.html', 'localtoc.html', 'relations.html']
'**': [
'about.html',
'donate.html',
'searchbox.html',
'localtoc.html',
'relations.html',
]
}
html_theme_options = {
'logo': 'logo.png',
'show_powered_by': False,
'fixed_sidebar': True,
'sidebar_collapse': True,
'analytics_id': 'UA-20736318-1',
'github_button': False,
}
# The favicon
@ -134,20 +146,23 @@ html_last_updated_fmt = '%b %d, %Y'
html_use_smartypants = True
# Overall title of the documentation
html_title = title
html_short_title = 'Start'
html_logo = 'resources/logo.png'
# html_title = title
html_short_title = _('Start')
from calibre.utils.localization import get_language
html_context = {}
html_context['other_languages'] = [
(lc, get_language(lc)) for lc in os.environ.get('ALL_USER_MANUAL_LANGUAGES', '').split() if lc != language]
def sort_languages(x):
from calibre.utils.icu import sort_key
lc, name = x
if lc == language:
return ''
return sort_key(unicode(name))
html_context['other_languages'].sort(key=sort_languages)
del sort_languages, get_language

View File

@ -327,6 +327,7 @@ def localized_path(app, langcode, pagename):
def add_html_context(app, pagename, templatename, context, *args):
context['localized_path'] = partial(localized_path, app)
context['change_language_text'] = cli_index_strings()[5]
context['search_box_text'] = cli_index_strings()[6]
def setup(app):

View File

@ -0,0 +1,35 @@
/*
* custom.css
* Copyright (C) 2017 Kovid Goyal
*
* Distributed under terms of the GPLv3 license.
*/
@media screen and (max-width: 875px) {
body {
padding-top: 0;
padding-bottom: 0;
}
}
.float-left-img { float: left; margin-right: 1em; margin-bottom: 1em }
.float-right-img { float: right; margin-left: 1em; margin-bottom: 1em }
.half-with-img { max-width: 50% }
.fit-img { max-width: 95% }
a, input[type="submit"] { cursor: pointer; }
#calibre-homepage-logo img { width: 64px; height: 64px }
div.sphinxsidebar { user-select: none }
div.sphinxsidebar a, a.reference { border-bottom: none }
div.sphinxsidebar a:hover, a.reference:hover { color: red; border-bottom: none }
div.document { margin-top: 0px; }
div.related { background-color: #39322b; color: white; font-family: sans-serif; padding: 0.5ex 0; }
div.related a { text-decoration: none; color: white; }
div.related a:hover { text-decoration: none; color: red; }

BIN
manual/resources/donate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 2411.2 2794" style="enable-background:new 0 0 2411.2 2794;" xml:space="preserve">
<style type="text/css">
.st0{fill:#FFFFFF;}
.st1{fill-rule:evenodd;clip-rule:evenodd;}
.st2{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
</style>
<g id="Layer_2">
</g>
<g id="Layer_x5F_1_x5F_1">
<g>
<polygon points="1204.6,359.2 271.8,30 271.8,2060.1 1204.6,1758.3 "/>
<polygon class="st0" points="1182.2,358.1 2150.6,29 2150.6,2059 1182.2,1757.3 "/>
<polygon class="st0" points="30,2415.4 1182.2,2031.4 1182.2,357.9 30,742 "/>
<polygon points="1707.2,2440.7 1870.5,2709.4 1956.6,2459.8 "/>
<g>
<path d="M421.7,934.8c-6.1-6,8,49.1,27.6,68.9c34.8,35.1,61.9,39.6,76.4,40.2c32,1.3,71.5-8,94.9-17.8
c22.7-9.7,62.4-30,77.5-59.6c3.2-6.3,11.9-17,6.4-43.2c-4.2-20.2-17-27.3-32.7-26.2c-15.7,1.1-63.2,13.7-86.1,20.8
c-23,7-70.3,21.4-90.9,25.8C474.3,948.2,429,941.7,421.7,934.8z"/>
<path d="M1003.1,1593.7c-9.1-3.3-196.9-81.1-223.6-93.9c-21.8-10.5-75.2-33.1-100.4-43.3c70.8-109.2,115.5-191.6,121.5-204.1
c11-23,86-169.6,87.7-178.7c1.7-9.1,3.8-42.9,2.2-51c-1.7-8.2-29.1,7.6-66.4,20.2c-37.4,12.6-108.4,58.8-135.8,64.6
c-27.5,5.7-115.5,39.1-160.5,54c-45,14.9-130.2,40.9-165.2,50.4c-35.1,9.5-65.7,10.2-85.3,16.2c0,0,2.6,27.5,7.8,35.7
c5.2,8.2,23.7,28.4,45.3,34.1c21.6,5.7,57.3,3.4,73.6-0.3c16.3-3.8,44.4-17.5,48.2-23.6c3.8-6.1-2-24.9,4.5-30.6
c6.5-5.6,92.2-25.7,124.6-35.4c32.4-10,156.3-52.6,173.1-50.5c-5.3,17.7-105,215.1-137.1,274c-32.1,58.9-218.6,318-258.3,363.6
c-30.1,34.7-103.2,123.5-128.5,143.6c6.4,1.8,51.6-2.1,59.9-7.2c51.3-31.6,136.9-138.1,164.4-170.5
c81.9-96,153.8-196.8,210.8-283.4h0.1c11.1,4.6,100.9,77.8,124.4,94c23.4,16.2,115.9,67.8,136,76.4c20,8.7,97.1,44.2,100.3,32.2
C1029.4,1668,1012.2,1597.1,1003.1,1593.7z"/>
</g>
<path class="st1" d="M569,2572c18,11,35,20,54,29c38,19,81,39,122,54c56,21,112,38,168,51c31,7,65,13,98,18c3,0,92,11,110,11h90
c35-3,68-5,103-10c28-4,59-9,89-16c22-5,45-10,67-17c21-6,45-14,68-22c15-5,31-12,47-18c13-6,29-13,44-19c18-8,39-19,59-29
c16-8,34-18,51-28c13-7,43-30,59-30c18,0,30,16,30,30c0,29-39,38-57,51c-19,13-42,23-62,34c-40,21-81,39-120,54
c-51,19-107,37-157,49c-19,4-38,9-57,12c-10,2-114,18-143,18h-132c-35-3-72-7-107-12c-31-5-64-11-95-18c-24-5-50-12-73-19
c-40-11-79-25-117-40c-69-26-141-60-209-105c-12-8-13-16-13-25c0-15,11-29,29-29C531,2546,563,2569,569,2572z"/>
<path class="st1" d="M1151,2009L61,2372V764l1090-363V2009z M1212,354v1680c-1,5-3,10-7,15c-2,3-6,7-9,8c-25,10-1151,388-1166,388
c-12,0-23-8-29-21c0-1-1-2-1-4V739c2-5,3-12,7-16c8-11,22-13,31-16c17-6,1126-378,1142-378C1190,329,1212,336,1212,354z"/>
<path class="st1" d="M2120,2017l-907-282V380l907-308V2017z M2181,32v2023c-1,23-17,33-32,33c-13,0-107-32-123-37
c-126-39-253-78-378-117c-28-9-57-18-84-27c-24-7-50-15-74-23c-107-33-216-66-323-102c-4-1-14-15-14-18V351c2-5,4-11,9-15
c8-9,351-123,486-168c36-13,487-168,501-168C2167,0,2181,13,2181,32z"/>
<polygon points="2411.2,2440.7 1199.5,2054.5 1204.6,373.2 2411.2,757.2 "/>
<g>
<path class="st2" d="M1800.3,1124.6L1681.4,1412l218.6,66.3L1800.3,1124.6z M1729,853.2l156.1,47.3l284.4,1025l-160.3-48.7
l-57.6-210.4L1620.2,1566l-71.3,171.4l-160.4-48.7L1729,853.2z"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,26 @@
<script type="text/javascript">
function toggle_languages_menu() {
var m = document.getElementById('languages-menu');
if (m.style.display === "block") m.style.display = "none";
else m.style.display = "block";
}
</script>
<div style="text-align: center">
<a href="https://calibre-ebook.com" title="calibre homepage" id="calibre-homepage-logo"><img src="_static/logo.png" /></a>
<br/>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" title="Contribute to support calibre development">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="AF4H3B8QVDG6N" />
<input type="image" src="{{ pathto('_static/donate.png', 1) }}" border="0" name="submit" alt="Contribute to support calibre development" style="border:0pt" />
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" />
</form>
</div>
{%- if not embedded %}
<div><a href="#" onclick="toggle_languages_menu(); return false;"><img src="{{ pathto('_static/languages.svg', 1) }}" style="width: 1.2em"/> {{ change_language_text }}</a></div>
<ul id="languages-menu" style="display:none">
{%- for lang in other_languages %}
<li><a href="{{ localized_path(lang[0], pagename) }}">{{ lang[1] }}</a></li>
{%- endfor %}
</ul>
{%- endif %}

View File

@ -1,31 +1,17 @@
{% extends "!layout.html" %}
{% block extrahead %}
<style type="text/css">
.float-left-img { float: left; margin-right: 1em; margin-bottom: 1em }
.float-right-img { float: right; margin-left: 1em; margin-bottom: 1em }
.half-with-img { max-width: 50% }
.fit-img { max-width: 95% }
#languages-menu { display: none }
.guilabel { font-style: italic }
</style>
<script type="text/javascript">
function toggle_languages_menu() {
var m = document.getElementById('languages-menu');
if (m.style.display === "block") m.style.display = "none";
else m.style.display = "block";
}
</script>
{%- block relbar1 %}{{ relbar() }}{% endblock %}
{% endblock %}
{% block document %}
{%- block content %}
<div class="document">
{{ sidebar() }}
{%- block document %}
<div class="documentwrapper">
{%- if render_sidebar %}
<div class="bodywrapper">
{%- endif %}
<div class="body">
{% if not embedded %}
{% if not embedded %}
<div class="body" role="main">
<div id="ad-container" style="text-align:center">
<script async="async" src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle"
@ -36,45 +22,16 @@
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>
{% endif %}
{% endif %}
{% block body %} {% endblock %}
</div>
</div>
{%- if render_sidebar %}
</div>
{%- endif %}
</div>
{% if not embedded %}
<script type="text/javascript">
window.ga=window.ga||function(){(ga.q=ga.q||[]).push(arguments)};ga.l=+new Date;
ga('create', 'UA-20736318-1', 'auto');
ga('send', 'pageview');
</script>
<script async src='https://www.google-analytics.com/analytics.js'></script>
{%- endif %}
{% endblock %}
{% block sidebarlogo %}
<p class="logo">
<a href="//calibre-ebook.com"><img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/></a>
</p>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" title="Contribute to support calibre development">
<input type="hidden" name="cmd" value="_s-xclick" />
<input type="hidden" name="hosted_button_id" value="AF4H3B8QVDG6N" />
<input type="image" src="{{ pathto('_static/simple_donate_button.gif', 1) }}" border="0" name="submit" alt="Contribute to support calibre development" style="border:0pt" />
<img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1" />
</form>
<hr/>
{%- if not embedded %}
<div><a href="#" onclick="toggle_languages_menu(); return false;">{{ change_language_text }}</a></div>
<ul id="languages-menu">
{%- for lang in other_languages %}
<li><a href="{{ localized_path(lang[0], pagename) }}">{{ lang[1] }}</a></li>
{%- endfor %}
</ul>
<hr/>
{%- endif %}
{% endblock %}
{%- endblock %}
<div class="clearer"></div>
</div>
{%- endblock %}

View File

@ -0,0 +1,13 @@
{%- if pagename != "search" and builder != "singlehtml" %}
<div id="searchbox" style="display: none" role="search">
<form class="search" action="{{ pathto('search') }}" method="get">
<div>
<input type="text" name="q" placeholder="{{ search_box_text }}" />&nbsp;
<input type="submit" value="{{ _('Go') }}" />
</div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
{%- endif %}

View File

@ -1142,7 +1142,7 @@ def cli_index_strings():
' are in :file:`/Applications/calibre.app/Contents/console.app/Contents/MacOS/`.'), _(
'Documented commands'), _('Undocumented commands'), _(
'You can see usage for undocumented commands by executing them without arguments in a terminal.'), _(
'Change language')
'Change language'), _('Search')
if __name__ == '__main__':