Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
2dot5
ClickHouse
提交
1c643205
C
ClickHouse
项目概览
2dot5
/
ClickHouse
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
ClickHouse
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
1c643205
编写于
10月 12, 2018
作者:
I
Ivan Blinkov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Pre-generate PDF version of docs
上级
2bed2d4b
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
161 addition
and
1 deletion
+161
-1
docs/tools/README.md
docs/tools/README.md
+1
-1
docs/tools/build.py
docs/tools/build.py
+7
-0
docs/tools/mkdocs-material-theme/assets/javascripts/lunr/lunr.fa.js
.../mkdocs-material-theme/assets/javascripts/lunr/lunr.fa.js
+0
-0
docs/tools/mkdocs-material-theme/assets/javascripts/lunr/lunr.zh.js
.../mkdocs-material-theme/assets/javascripts/lunr/lunr.zh.js
+146
-0
docs/tools/mkdocs-material-theme/partials/nav.html
docs/tools/mkdocs-material-theme/partials/nav.html
+7
-0
未找到文件。
docs/tools/README.md
浏览文件 @
1c643205
...
...
@@ -16,7 +16,7 @@ Usually those have some way to preview how Markdown will look like, which allows
It'll take some effort to go through, but the result will be very close to production documentation.
For the first time you'll need to set up virtualenv:
For the first time you'll need to
install
[
wkhtmltopdf
](
https://wkhtmltopdf.org/
)
and
set up virtualenv:
```
bash
$
cd
ClickHouse/docs/tools
...
...
docs/tools/build.py
浏览文件 @
1c643205
...
...
@@ -8,6 +8,7 @@ import datetime
import
logging
import
os
import
shutil
import
subprocess
import
sys
import
tempfile
...
...
@@ -151,6 +152,12 @@ def build_single_page_version(lang, args, cfg):
single_page_output_path
)
single_page_index_html
=
os
.
path
.
abspath
(
os
.
path
.
join
(
single_page_output_path
,
'index.html'
))
single_page_pdf
=
single_page_index_html
.
replace
(
'index.html'
,
'clickhouse_%s.pdf'
%
lang
)
create_pdf_command
=
[
'wkhtmltopdf'
,
'--print-media-type'
,
single_page_index_html
,
single_page_pdf
]
logging
.
debug
(
' '
.
join
(
create_pdf_command
))
subprocess
.
check_call
(
' '
.
join
(
create_pdf_command
),
shell
=
True
)
def
build_redirects
(
args
):
lang_re_fragment
=
args
.
lang
.
replace
(
','
,
'|'
)
...
...
docs/tools/mkdocs-material-theme/assets/javascripts/lunr/lunr.fa.js
0 → 100644
浏览文件 @
1c643205
docs/tools/mkdocs-material-theme/assets/javascripts/lunr/lunr.zh.js
0 → 100644
浏览文件 @
1c643205
i
/**
* lunr对中文分词的支持
*/
;
(
function
(
root
,
factory
)
{
if
(
typeof
define
===
'
function
'
&&
define
.
amd
)
{
// AMD. Register as an anonymous module.
define
(
factory
)
}
else
if
(
typeof
exports
===
'
object
'
)
{
/**
* Node. Does not work with strict CommonJS, but
* only CommonJS-like environments that support module.exports,
* like Node.
*/
module
.
exports
=
factory
()
}
else
{
// Browser globals (root is window)
factory
()(
root
.
lunr
);
}
}(
this
,
function
()
{
/**
* Just return a value to define the module export.
* This example returns an object, but the module
* can return a function as the exported value.
*/
return
function
(
lunr
)
{
/*
Thai tokenization is the same to Japanense, which does not take into account spaces.
So, it uses the same logic to assign tokenization function due to different Lunr versions.
*/
var
isLunr2
=
lunr
.
version
[
0
]
==
"
2
"
;
/* register specific locale function */
lunr
.
zhcn
=
function
()
{
this
.
pipeline
.
reset
();
this
.
pipeline
.
add
(
lunr
.
zhcn
.
trimmer
,
lunr
.
zhcn
.
stopWordFilter
,
lunr
.
zhcn
.
stemmer
);
if
(
isLunr2
)
{
// for lunr version 2.0.0
this
.
tokenizer
=
lunr
.
zhcn
.
tokenizer
;
}
else
{
if
(
lunr
.
tokenizer
)
{
// for lunr version 0.6.0
lunr
.
tokenizer
=
lunr
.
zhcn
.
tokenizer
;
}
if
(
this
.
tokenizerFn
)
{
// for lunr version 0.7.0 -> 1.0.0
this
.
tokenizerFn
=
lunr
.
zhcn
.
tokenizer
;
}
}
};
var
segmenter
=
new
lunr
.
TinySegmenter
();
lunr
.
zhcn
.
tokenizer
=
function
(
obj
)
{
var
i
;
var
str
;
var
len
;
var
segs
;
var
tokens
;
var
char
;
var
sliceLength
;
var
sliceStart
;
var
sliceEnd
;
var
segStart
;
if
(
!
arguments
.
length
||
obj
==
null
||
obj
==
undefined
)
return
[];
if
(
Array
.
isArray
(
obj
))
{
return
obj
.
map
(
function
(
t
)
{
return
isLunr2
?
new
lunr
.
Token
(
t
.
toLowerCase
())
:
t
.
toLowerCase
();
}
);
}
str
=
obj
.
toString
().
toLowerCase
().
replace
(
/^
\s
+/
,
''
);
for
(
i
=
str
.
length
-
1
;
i
>=
0
;
i
--
)
{
if
(
/
\S
/
.
test
(
str
.
charAt
(
i
)))
{
str
=
str
.
substring
(
0
,
i
+
1
);
break
;
}
}
tokens
=
[];
len
=
str
.
length
;
for
(
sliceEnd
=
0
,
sliceStart
=
0
;
sliceEnd
<=
len
;
sliceEnd
++
)
{
char
=
str
.
charAt
(
sliceEnd
);
sliceLength
=
sliceEnd
-
sliceStart
;
if
((
char
.
match
(
/
\s
/
)
||
sliceEnd
==
len
))
{
if
(
sliceLength
>
0
)
{
segs
=
segmenter
.
segment
(
str
.
slice
(
sliceStart
,
sliceEnd
)).
filter
(
function
(
token
)
{
return
!!
token
;
}
);
segStart
=
sliceStart
;
for
(
i
=
0
;
i
<
segs
.
length
;
i
++
)
{
if
(
isLunr2
)
{
tokens
.
push
(
new
lunr
.
Token
(
segs
[
i
],
{
position
:
[
segStart
,
segs
[
i
].
length
],
index
:
tokens
.
length
}
)
);
}
else
{
tokens
.
push
(
segs
[
i
]);
}
segStart
+=
segs
[
i
].
length
;
}
}
sliceStart
=
sliceEnd
+
1
;
}
}
return
tokens
;
}
lunr
.
zhcn
.
stemmer
=
(
function
(){
return
function
(
word
)
{
return
word
;
}
})();
lunr
.
Pipeline
.
registerFunction
(
lunr
.
zhcn
.
stemmer
,
'
stemmer-zhcn
'
);
/* lunr trimmer function */
lunr
.
zhcn
.
wordCharacters
=
"
一二三四五六七八九十百千万億兆一-龠々〆ヵヶぁ-んァ-ヴーア-ン゙a-zA-Za-zA-Z0-90-9
"
;
lunr
.
zhcn
.
trimmer
=
lunr
.
trimmerSupport
.
generateTrimmer
(
lunr
.
zhcn
.
wordCharacters
);
lunr
.
Pipeline
.
registerFunction
(
lunr
.
zhcn
.
trimmer
,
'
trimmer-zhcn
'
);
/* lunr stop word filter. see https://www.ranks.nl/stopwords/chinese-stopwords */
lunr
.
zhcn
.
stopWordFilter
=
lunr
.
generateStopWordFilter
(
'
的 一 不 在 人 有 是 为 以 于 上 他 而 后 之 来 及 了 因 下 可 到 由 这 与 也 此 但 并 个 其 已 无 小 我 们 起 最 再 今 去 好 只 又 或 很 亦 某 把 那 你 乃 它 吧 被 比 别 趁 当 从 到 得 打 凡 儿 尔 该 各 给 跟 和 何 还 即 几 既 看 据 距 靠 啦 了 另 么 每 们 嘛 拿 哪 那 您 凭 且 却 让 仍 啥 如 若 使 谁 虽 随 同 所 她 哇 嗡 往 哪 些 向 沿 哟 用 于 咱 则 怎 曾 至 致 着 诸 自
'
.
split
(
'
'
));
lunr
.
Pipeline
.
registerFunction
(
lunr
.
zhcn
.
stopWordFilter
,
'
stopWordFilter-zhcn
'
);
};
}))
docs/tools/mkdocs-material-theme/partials/nav.html
浏览文件 @
1c643205
...
...
@@ -29,6 +29,13 @@
{% endif %}
{% endif %}
</li>
<li
class=
"md-nav__item md-nav__item--active"
>
{% if config.theme.language == 'ru' %}
<a
href=
"{{ base_url }}/single/clickhouse_{{ config.theme.language }}.pdf"
class=
"md-nav__link md-nav__link--active"
>
PDF версия
</a>
{% else %}
<a
href=
"{{ base_url }}/single/clickhouse_{{ config.theme.language }}.pdf"
class=
"md-nav__link md-nav__link--active"
>
PDF version
</a>
{% endif %}
</li>
{% if config.repo_url %}
<li
class=
"md-nav__item md-nav__item--active"
>
<a
href=
"{{ config.repo_url }}"
rel=
"external nofollow"
target=
"_blank"
class=
"md-nav__link"
>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录