CLICKHOUSE-3067: some documentation style tuning

This commit is contained in:
Ivan Blinkov 2017-07-31 21:12:53 +03:00
parent 6670b8b328
commit 50cbb31406
8 changed files with 123 additions and 19 deletions

View File

@ -24,8 +24,8 @@ I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) ru
default: default:
$(SPHINXBUILD) -b html $(SPHINXOPTS) ru $(BUILDDIR)/docs/ru $(SPHINXBUILD) -b html $(SPHINXOPTS) ru $(BUILDDIR)/docs/ru
$(SPHINXBUILD) -b html $(SPHINXOPTS) en $(BUILDDIR)/docs/en $(SPHINXBUILD) -b html $(SPHINXOPTS) en $(BUILDDIR)/docs/en
SPHINX_TEMPLATES=../_singlehtml_templates $(SPHINXBUILD) -b singlehtml $(SPHINXOPTS) ru $(BUILDDIR)/docs/ru/single $(SPHINXBUILD) -b singlehtml $(SPHINXOPTS) ru $(BUILDDIR)/docs/ru/single
SPHINX_TEMPLATES=../_singlehtml_templates $(SPHINXBUILD) -b singlehtml $(SPHINXOPTS) en $(BUILDDIR)/docs/en/single $(SPHINXBUILD) -b singlehtml $(SPHINXOPTS) en $(BUILDDIR)/docs/en/single
help: help:
@echo "Please use \`make <target>' where <target> is one of" @echo "Please use \`make <target>' where <target> is one of"

View File

@ -1,10 +0,0 @@
<h3>{{ _('Navigation') }}</h3>
{{ toctree(includehidden=theme_sidebar_includehidden, collapse=False) }}
{% if theme_extra_nav_links %}
<hr />
<ul>
{% for text, uri in theme_extra_nav_links.items() %}
<li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
{% endfor %}
</ul>
{% endif %}

View File

@ -1,23 +1,65 @@
div.document, div.footer { div.document {
margin: 20px auto 0 auto;
}
div.document,
div.footer {
width: 1240px; width: 1240px;
} }
div.sphinxsidebarwrapper { div.sphinxsidebarwrapper {
padding: 2px 10px; padding: 2px 10px;
} }
div.body dd, div.body li, div.body p { div.body p {
line-height: 1.6em; line-height: 1.6em;
} }
div.body blockquote, div.body dd, div.body li, div.body p { div.body dd,
div.body li {
line-height: 1.2em;
margin-bottom: 0.4em;
}
div.body blockquote,
div.body dd,
div.body li,
div.body p {
-moz-hyphens: none; -moz-hyphens: none;
-ms-hyphens: none; -ms-hyphens: none;
-webkit-hyphens: none; -webkit-hyphens: none;
hyphens: none; hyphens: none;
} }
input {
padding: 2px;
}
div.sphinxsidebar #searchbox input[type="text"] {
width: 190px;
}
div.sphinxsidebar #searchbox input[type="submit"],
#search-form input[type="submit"] {
padding: 4px 8px;
}
#searchbox, #extra-nav-links {
margin: 20px 0;
}
ol ol ul,
ol ul ul,
ul ol ul,
ul ul ul,
ul ul,
ol ul,
div.sphinxsidebar ul ul,
div.sphinxsidebar ul.want-points
{
list-style-type: disc;
}
blockquote {
line-height: 1.4em;
border-left: 4px solid #ccc;
margin: 0;
padding: 0 0 0 20px;
}
div.sphinxsidebarwrapper p.logo { div.sphinxsidebarwrapper p.logo {
float: left; float: left;
text-align: left; text-align: left;
margin: -4px 4px 0 0; margin: -2px 6px 0 0;
} }
div.sphinxsidebar a { div.sphinxsidebar a {
@ -26,7 +68,10 @@ div.sphinxsidebar a {
} }
pre { pre {
padding: 4px; padding: 6px;
}
code {
padding: 2px;
} }
input { input {

8
docs/_templates/navigation.html vendored Normal file
View File

@ -0,0 +1,8 @@
{% if theme_extra_nav_links %}
<ul id="extra-nav-links">
{% for text, uri in theme_extra_nav_links.items() %}
<li class="toctree-l1"><a href="{{ uri }}">{{ text }}</a></li>
{% endfor %}
</ul>
{% endif %}
{{ toctree(includehidden=theme_sidebar_includehidden, collapse=builder != "singlehtml") }}

50
docs/_templates/search.html vendored Normal file
View File

@ -0,0 +1,50 @@
{%- extends "layout.html" %}
{% set title = _('Search') %}
{% set script_files = script_files + ['_static/searchtools.js'] %}
{% block extrahead %}
<script type="text/javascript">
jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); });
</script>
{# this is used when loading the search index using $.ajax fails,
such as on Chrome for documents on localhost #}
<script type="text/javascript" id="searchindexloader"></script>
{{ super() }}
{% endblock %}
{% block body %}
<h1 id="search-documentation">{{ _('Search') }}</h1>
<div id="fallback" class="admonition warning">
<script type="text/javascript">$('#fallback').hide();</script>
<p>
{% trans %}Please activate JavaScript to enable the search
functionality.{% endtrans %}
</p>
</div>
<p>
{% trans %}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 fewer words won't appear in the result list.{% endtrans %}
</p>
<form id="search-form" action="" method="get">
<input type="text" name="q" value="" />
<input type="submit" value="{{ _('Search') }}" />
<span id="search-progress" style="padding-left: 10px"></span>
</form>
{% if search_performed %}
<h2>{{ _('Search Results') }}</h2>
{% if not search_results %}
<p>{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}</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 %}

11
docs/_templates/searchbox.html vendored Normal file
View File

@ -0,0 +1,11 @@
{%- 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="{{ _('Quick search') }}" /></div>
<div><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

@ -174,9 +174,9 @@ html_static_path = ['../_static']
html_sidebars = { html_sidebars = {
'**': [ '**': [
'about.html', 'about.html',
'searchbox.html',
'navigation.html', 'navigation.html',
'relations.html', 'relations.html',
'searchbox.html',
] ]
} }

View File

@ -174,9 +174,9 @@ html_static_path = ['../_static']
html_sidebars = { html_sidebars = {
'**': [ '**': [
'about.html', 'about.html',
'searchbox.html',
'navigation.html', 'navigation.html',
'relations.html', 'relations.html',
'searchbox.html',
] ]
} }