From bd98072259e4787521cd02bfc3b7b67c59f64fcb Mon Sep 17 00:00:00 2001 From: Ivan Blinkov Date: Fri, 29 Dec 2017 18:45:21 +0300 Subject: [PATCH] Some progress on website and docs (#1717) * Add link to Beijing meetup * ignore presentations * introduce requirements.txt * Apply hacks by bayonet@ using monkey patching * Simplify and fix patching of "single" docs on Mac OS (it still has a bug on chunk borders though) --- .gitignore | 1 + docs/Makefile | 3 +- docs/requirements.txt | 20 ++++++++++ docs/ru/conf.py | 90 ++++++++++++++++++++++++++++++++++++++++++- website/gulpfile.js | 2 +- website/index.html | 6 ++- website/release.sh | 5 ++- 7 files changed, 120 insertions(+), 7 deletions(-) create mode 100644 docs/requirements.txt diff --git a/.gitignore b/.gitignore index 5451784e41d..bb339eac140 100644 --- a/.gitignore +++ b/.gitignore @@ -232,3 +232,4 @@ config-preprocessed.xml node_modules public website/docs +website/presentations diff --git a/docs/Makefile b/docs/Makefile index 111998099c2..6723b10e52f 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -25,9 +25,8 @@ default: $(SPHINXBUILD) -b html $(SPHINXOPTS) ru $(BUILDDIR)/docs/ru $(SPHINXBUILD) -b html $(SPHINXOPTS) en $(BUILDDIR)/docs/en $(SPHINXBUILD) -b singlehtml $(SPHINXOPTS) ru $(BUILDDIR)/docs/ru/single - sed -i "s|external\\\\\" href=\\\\\"[\.a-z_-\/]*#|external\\\\\" href=\\\\\"#|g" 'build/docs/ru/single/index.html' $(SPHINXBUILD) -b singlehtml $(SPHINXOPTS) en $(BUILDDIR)/docs/en/single - sed -i "s|external\\\\\" href=\\\\\"[\.a-z_-\/]*#|external\\\\\" href=\\\\\"#|g" 'build/docs/en/single/index.html' + perl -pi -e 's|external\\" href=\\"[^#]+#|external\\" href=\\"#|g' $(BUILDDIR)/docs/ru/single/index.html $(BUILDDIR)/docs/en/single/index.html help: @echo "Please use \`make ' where is one of" diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000000..ceaeff0fcf7 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,20 @@ +alabaster==0.7.10 +Babel==2.5.1 +certifi==2017.11.5 +chardet==3.0.4 +CommonMark==0.5.4 +docutils==0.14 +idna==2.6 +imagesize==0.7.1 +Jinja2==2.10 +MarkupSafe==1.0 +Pygments==2.2.0 +pytz==2017.3 +recommonmark==0.4.0 +requests==2.18.4 +six==1.11.0 +snowballstemmer==1.2.1 +Sphinx==1.6.5 +sphinxcontrib-websupport==1.0.1 +typing==3.6.2 +urllib3==1.22 diff --git a/docs/ru/conf.py b/docs/ru/conf.py index 20907ed1ac2..7e6ac5341b6 100644 --- a/docs/ru/conf.py +++ b/docs/ru/conf.py @@ -20,6 +20,94 @@ import sys from recommonmark.parser import CommonMarkParser from recommonmark.transform import AutoStructify +from docutils import nodes, transforms + +nodes._non_id_translate.update({ + 0x0410: u'A', # @bayonet: cyrillic A + 0x0411: u'B', # @bayonet: cyrillic Б + 0x0412: u'V', # @bayonet: cyrillic В + 0x0413: u'G', # @bayonet: cyrillic Г + 0x0414: u'D', # @bayonet: cyrillic Д + 0x0415: u'E', # @bayonet: cyrillic Е + 0x0416: u'ZH', # @bayonet: cyrillic Ж + 0x0417: u'Z', # @bayonet: cyrillic З + 0x0418: u'I', # @bayonet: cyrillic И + 0x0419: u'I', # @bayonet: cyrillic Й + 0x041A: u'K', # @bayonet: cyrillic К + 0x041B: u'L', # @bayonet: cyrillic Л + 0x041C: u'M', # @bayonet: cyrillic М + 0x041D: u'N', # @bayonet: cyrillic Н + 0x041E: u'O', # @bayonet: cyrillic О + 0x041F: u'P', # @bayonet: cyrillic П + 0x0420: u'R', # @bayonet: cyrillic Р + 0x0421: u'C', # @bayonet: cyrillic С + 0x0422: u'T', # @bayonet: cyrillic Т + 0x0423: u'U', # @bayonet: cyrillic У + 0x0424: u'PH', # @bayonet: cyrillic Ф + 0x0425: u'H', # @bayonet: cyrillic Х + 0x0426: u'CZ', # @bayonet: cyrillic Ц + 0x0427: u'CH', # @bayonet: cyrillic Ч + 0x0428: u'SH', # @bayonet: cyrillic Ш + 0x0429: u'SH', # @bayonet: cyrillic Щ +# 0x042A: u'', # @bayonet: cyrillic Ъ + 0x042B: u'Y', # @bayonet: cyrillic Ы +# 0x042C: u'', # @bayonet: cyrillic Ь + 0x042D: u'E', # @bayonet: cyrillic Э + 0x042E: u'YU', # @bayonet: cyrillic Ю + 0x042F: u'YA', # @bayonet: cyrillic Я + 0x0430: u'a', # @bayonet: cyrillic а + 0x0431: u'b', # @bayonet: cyrillic б + 0x0432: u'v', # @bayonet: cyrillic в + 0x0433: u'g', # @bayonet: cyrillic г + 0x0434: u'd', # @bayonet: cyrillic д + 0x0435: u'e', # @bayonet: cyrillic е + 0x0436: u'zh', # @bayonet: cyrillic ж + 0x0437: u'z', # @bayonet: cyrillic з + 0x0438: u'i', # @bayonet: cyrillic и + 0x0439: u'i', # @bayonet: cyrillic й + 0x043A: u'k', # @bayonet: cyrillic к + 0x043B: u'l', # @bayonet: cyrillic л + 0x043C: u'm', # @bayonet: cyrillic м + 0x043D: u'n', # @bayonet: cyrillic н + 0x043E: u'o', # @bayonet: cyrillic о + 0x043F: u'p', # @bayonet: cyrillic п + 0x0440: u'r', # @bayonet: cyrillic р + 0x0441: u's', # @bayonet: cyrillic с + 0x0442: u't', # @bayonet: cyrillic т + 0x0443: u'u', # @bayonet: cyrillic у + 0x0444: u'ph', # @bayonet: cyrillic ф + 0x0445: u'h', # @bayonet: cyrillic х + 0x0446: u'cz', # @bayonet: cyrillic ц + 0x0447: u'ch', # @bayonet: cyrillic ч + 0x0448: u'sh', # @bayonet: cyrillic ш + 0x0449: u'sh', # @bayonet: cyrillic щ +# 0x044A: u'', # @bayonet: cyrillic ъ + 0x044B: u'y', # @bayonet: cyrillic ы +# 0x044C: u'', # @bayonet: cyrillic ь + 0x044D: u'e', # @bayonet: cyrillic э + 0x044E: u'yu', # @bayonet: cyrillic ю + 0x044F: u'ya', # @bayonet: cyrillic я + 0x0401: u'YO', # @bayonet: cyrillic Ё + 0x0451: u'yo' # @bayonet: cyrillic ё +}) + + +def autostructify_parse_ref(self, ref): + assert isinstance(ref, nodes.reference) + title = None + if len(ref.children) == 0: + title = ref['name'] + elif isinstance(ref.children[0], nodes.Text): + title = ref.children[0].astext() + uri = ref['refuri'] + if uri.find('://') != -1: + return (title, uri, None) + uri=uri.replace('.md','.html') + return (title, uri, None) + + +AutoStructify.parse_ref = autostructify_parse_ref + source_parsers = { '.md': CommonMarkParser, } @@ -308,4 +396,4 @@ def setup(app): app.connect(str('builder-inited'), add_filters) app.add_config_value('recommonmark_config', {'enable_eval_rst': True}, True) app.add_transform(AutoStructify) - \ No newline at end of file + diff --git a/website/gulpfile.js b/website/gulpfile.js index a47e286e433..66cbac86cd3 100644 --- a/website/gulpfile.js +++ b/website/gulpfile.js @@ -98,7 +98,7 @@ gulp.task('scripts', ['docs'], function () { gulp.task('styles', ['docs'], function () { return gulp.src(paths.styles) - .pipe(cleanCss({inline: ['none']})) + .pipe(cleanCss()) .pipe(gulp.dest(outputDir)) }); diff --git a/website/index.html b/website/index.html index 5e4d4627437..129d463158d 100644 --- a/website/index.html +++ b/website/index.html @@ -90,7 +90,11 @@
- +

ClickHouse. Just makes you think faster.

diff --git a/website/release.sh b/website/release.sh index 44d8302626a..05b75d3f8e8 100755 --- a/website/release.sh +++ b/website/release.sh @@ -12,12 +12,13 @@ fi FULL_NAME="${IMAGE}:${TAG}" REMOTE_NAME="registry.yandex.net/${FULL_NAME}" DOCKER_HASH="$2" +GULP="$BASE_DIR/node_modules/gulp/bin/gulp.js" if [[ -z "$1" ]] then git clone --recursive https://github.com/yandex/clickhouse-presentations.git presentations || true git --work-tree=$(readlink -f presentations) --git-dir=$(readlink -f presentations)/.git pull - gulp clean - gulp build + $GULP clean + $GULP build docker build -t "${FULL_NAME}" "${BASE_DIR}" docker tag "${FULL_NAME}" "${REMOTE_NAME}" DOCKER_HASH=$(docker push "${REMOTE_NAME}" | tail -1 | awk '{print $3;}')