diff --git a/manual/conf.py b/manual/conf.py index 0a5bf421f6..e56bebe781 100644 --- a/manual/conf.py +++ b/manual/conf.py @@ -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 diff --git a/manual/custom.py b/manual/custom.py index 86f415b38e..bcaf5c46ae 100644 --- a/manual/custom.py +++ b/manual/custom.py @@ -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): diff --git a/manual/resources/custom.css b/manual/resources/custom.css new file mode 100644 index 0000000000..ccbbaab07a --- /dev/null +++ b/manual/resources/custom.css @@ -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; } + + diff --git a/manual/resources/donate.png b/manual/resources/donate.png new file mode 100644 index 0000000000..f21829867b Binary files /dev/null and b/manual/resources/donate.png differ diff --git a/manual/resources/languages.svg b/manual/resources/languages.svg new file mode 100644 index 0000000000..dd72ce65ea --- /dev/null +++ b/manual/resources/languages.svg @@ -0,0 +1,48 @@ + + + diff --git a/manual/resources/logo.png b/manual/resources/logo.png index c952d762bf..81adc85c63 100644 Binary files a/manual/resources/logo.png and b/manual/resources/logo.png differ diff --git a/manual/resources/simple_donate_button.gif b/manual/resources/simple_donate_button.gif deleted file mode 100644 index 42dd2c3c88..0000000000 Binary files a/manual/resources/simple_donate_button.gif and /dev/null differ diff --git a/manual/templates/about.html b/manual/templates/about.html new file mode 100644 index 0000000000..f58cee971f --- /dev/null +++ b/manual/templates/about.html @@ -0,0 +1,26 @@ + + +
+{%- if not embedded %} + + +{%- endif %} diff --git a/manual/templates/layout.html b/manual/templates/layout.html index 35e02fffdb..4c528e20c7 100644 --- a/manual/templates/layout.html +++ b/manual/templates/layout.html @@ -1,31 +1,17 @@ {% extends "!layout.html" %} -{% block extrahead %} - - +{%- block relbar1 %}{{ relbar() }}{% endblock %} -{% endblock %} - -{% block document %} +{%- block content %} +