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)
This commit is contained in:
Ivan Blinkov 2017-12-29 18:45:21 +03:00 committed by alexey-milovidov
parent 1610abdd5c
commit bd98072259
7 changed files with 120 additions and 7 deletions

1
.gitignore vendored
View File

@ -232,3 +232,4 @@ config-preprocessed.xml
node_modules
public
website/docs
website/presentations

View File

@ -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 <target>' where <target> is one of"

20
docs/requirements.txt Normal file
View File

@ -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

View File

@ -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)

View File

@ -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))
});

View File

@ -90,7 +90,11 @@
<div class="clear"></div>
</div>
</div>
<div id="announcement" class="colored-block">
<div class="page">
<a id="announcement-link" href="http://www.clickhouse.com.cn/topic/5a368a2e395dd67a5b98e850" rel="external nofollow" target="_blank">ClickHouse Community Meetup in Beijing on January 27, 2018</a>
</div>
</div>
<div class="page">
<h2 id="slogan">ClickHouse. Just makes you think faster.</h2>

View File

@ -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;}')