From 0853d02abe96e17048f17ee8bd3a4a700fd3d419 Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Tue, 30 May 2017 13:45:59 +0300 Subject: [PATCH] CLICKHOUSE-2981: docs styles more similar to main website + add flags to switch language links --- docs/_static/custom.css | 5 ++++- docs/en/conf.py | 22 +++++++++++++--------- docs/ru/conf.py | 28 ++++++++++++++++------------ website/gulpfile.js | 3 ++- 4 files changed, 35 insertions(+), 23 deletions(-) diff --git a/docs/_static/custom.css b/docs/_static/custom.css index 59b1ed2463c..7cf5c02696d 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,5 +1,8 @@ +div.document, div.footer { + width: 1240px; +} div.sphinxsidebarwrapper { - padding: 2px 10px; + padding: 2px 10px; } div.sphinxsidebarwrapper p.logo { diff --git a/docs/en/conf.py b/docs/en/conf.py index d37b33208a8..a018fa8d464 100644 --- a/docs/en/conf.py +++ b/docs/en/conf.py @@ -11,6 +11,7 @@ # # All configuration values have a default; values that are commented out # serve to show the default. +from __future__ import unicode_literals import collections import os @@ -49,8 +50,8 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'ClickHouse' -copyright = u'2016–2017 Yandex LLC' +project = 'ClickHouse' +copyright = '2016–2017 Yandex LLC' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -120,8 +121,11 @@ html_theme_options = { 'head_font_family': font_family, 'caption_font_family': font_family, 'show_powered_by': False, + 'body_text': '#000', + 'link': '#08f', + 'link_hover': 'red', 'extra_nav_links': collections.OrderedDict([ - ('Documentation in Russian', '/docs/ru/'), + ('Switch to Russian 🇷🇺 ', '/docs/ru/'), ('Single page documentation', '/docs/en/single/'), ('Website home', '/'), ('GitHub', 'https://github.com/yandex/ClickHouse'), @@ -226,8 +230,8 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'ClickHouse.tex', u'ClickHouse Documentation', - u'Yandex LLC', 'manual'), + ('index', 'ClickHouse.tex', 'ClickHouse Documentation', + 'Yandex LLC', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -256,8 +260,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'clickhouse', u'ClickHouse Documentation', - [u'Yandex LLC'], 1) + ('index', 'clickhouse', 'ClickHouse Documentation', + ['Yandex LLC'], 1) ] # If true, show URL addresses after external links. @@ -270,8 +274,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'ClickHouse', u'ClickHouse Documentation', - u'Yandex LLC', 'ClickHouse', 'One line description of project.', + ('index', 'ClickHouse', 'ClickHouse Documentation', + 'Yandex LLC', 'ClickHouse', 'One line description of project.', 'Miscellaneous'), ] diff --git a/docs/ru/conf.py b/docs/ru/conf.py index 4c87cc7b181..00e26c60197 100644 --- a/docs/ru/conf.py +++ b/docs/ru/conf.py @@ -11,6 +11,7 @@ # # All configuration values have a default; values that are commented out # serve to show the default. +from __future__ import unicode_literals import collections import os @@ -49,8 +50,8 @@ source_suffix = '.rst' master_doc = 'index' # General information about the project. -project = u'ClickHouse' -copyright = u'2016–2017 Yandex LLC' +project = 'ClickHouse' +copyright = '2016–2017 Yandex LLC' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -120,11 +121,14 @@ html_theme_options = { 'head_font_family': font_family, 'caption_font_family': font_family, 'show_powered_by': False, + 'body_text': '#000', + 'link': '#08f', + 'link_hover': 'red', 'extra_nav_links': collections.OrderedDict([ - (u'Documentation in English', '/docs/en/'), - (u'Документация на одной странице', '/docs/ru/single/'), - (u'Главная страница сайта', '/'), - (u'GitHub', 'https://github.com/yandex/ClickHouse'), + ('Switch to English 🇬🇧', '/docs/en/'), + ('Документация на одной странице', '/docs/ru/single/'), + ('Главная страница сайта', '/'), + ('GitHub', 'https://github.com/yandex/ClickHouse'), ]) } @@ -226,8 +230,8 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - ('index', 'ClickHouse.tex', u'ClickHouse Documentation', - u'Yandex LLC', 'manual'), + ('index', 'ClickHouse.tex', 'ClickHouse Documentation', + 'Yandex LLC', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -256,8 +260,8 @@ latex_documents = [ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - ('index', 'clickhouse', u'ClickHouse Documentation', - [u'Yandex LLC'], 1) + ('index', 'clickhouse', 'ClickHouse Documentation', + ['Yandex LLC'], 1) ] # If true, show URL addresses after external links. @@ -270,8 +274,8 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - ('index', 'ClickHouse', u'ClickHouse Documentation', - u'Yandex LLC', 'ClickHouse', 'One line description of project.', + ('index', 'ClickHouse', 'ClickHouse Documentation', + 'Yandex LLC', 'ClickHouse', 'One line description of project.', 'Miscellaneous'), ] diff --git a/website/gulpfile.js b/website/gulpfile.js index 5ff641d37fa..7cef729b2cd 100644 --- a/website/gulpfile.js +++ b/website/gulpfile.js @@ -87,7 +87,8 @@ gulp.task('images', [], function () { gulp.task('watch', function () { gulp.watch(paths.htmls, ['htmls']); - gulp.watch(paths.htmls, ['reference']); + gulp.watch(docsDir, ['docs']); + gulp.watch(paths.reference, ['reference']); gulp.watch(paths.scripts, ['scripts']); gulp.watch(paths.images, ['images']); });