Skip to content

Commit 13dc76d

Browse files
committed
support pdf
1 parent 38d3fbc commit 13dc76d

File tree

5 files changed

+125
-0
lines changed

5 files changed

+125
-0
lines changed

Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pdf:
2+
rm -rf ./build
3+
cp -r ./docs ./build
4+
python ./pdf_adapter.py
5+
docker run --rm -v "${PWD}/build":/gitbook -p 4000:4000 billryan/gitbook:zh-hans /bin/bash -c "gitbook install && gitbook pdf ./ ./sqle-manual.pdf"

docs/SUMMARY.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Summary
2+
3+
* [产品介绍](intro.md)
4+
* [在线体验](online-demo.md)
5+
* [社区支持](community-support.md)
6+
* [商业支持](commercial-support.md)
7+
* [快速开始](quick-usage.md)
8+
9+
* [安装部署]
10+
* [安装说明](deploy-manual/intro.md)
11+
* [配置文件说明](deploy-manual/config.md)
12+
* [源码安装](deploy-manual/source.md)
13+
* [RPM 安装](deploy-manual/rpm.md)
14+
* [Docker 部署](deploy-manual/docker.md)
15+
* [Docker Compose 部署](deploy-manual/docker-compose.md)
16+
17+
* [用户手册]
18+
* [项目]
19+
* [功能介绍](user-manual/project/intro.md)
20+
* [创建项目【企业版】](user-manual/project/project_create.md)
21+
* [数据源管理](user-manual/project/instance-manager.md)
22+
* [成员/成员组管理](user-manual/project/group_member.md)
23+
* [审核规则模板](user-manual/project/rule-template-manager.md)
24+
* [审核流程模板](user-manual/project/workflow-template-manager.md)
25+
* [白名单管理【企业版】](user-manual/project/whitelist-manager.md)
26+
* [工单]
27+
* [功能说明](user-manual/project/workflow/intro.md)
28+
* [创建工单](user-manual/project/workflow/create-workflow.md)
29+
* [审核工单](user-manual/project/workflow/audit-workflow.md)
30+
* [上线工单](user-manual/project/workflow/exec-workflow.md)
31+
* [扫描任务]
32+
* [功能说明](user-manual/project/audit_task/intro.md)
33+
* [库表元数据](user-manual/project/audit_task/metadata_audit.md)
34+
* [慢日志](user-manual/project/audit_task/slowlog_audit.md)
35+
* [系统设置]
36+
* [功能介绍](user-manual/sys-configuration/intro.md)
37+
* [登录对接](user-manual/sys-configuration/login_syn.md)
38+
* [消息推送](user-manual/sys-configuration/message_syn.md)
39+
* [流程对接](user-manual/sys-configuration/process_syn.md)
40+
* [外部数据源同步【企业版】](user-manual/sys-configuration/instance_syn.md)
41+
* [工作台]
42+
* [功能介绍](user-manual/sql-workbench/introduction.md)
43+
* [配置方法](user-manual/sql-workbench/how-to-configure.md)
44+
* [使用定制包快速搭建环境](user-manual/sql-workbench/how-to-use.md)
45+
* [用户管理]
46+
* [功能介绍](user-manual/user-manager/intro.md)
47+
* [用户管理](user-manual/user-manager/user.md)
48+
* [用户组管理](user-manual/user-manager/user-group.md)
49+
* [角色管理](user-manual/user-manager/role.md)

docs/book.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"plugins": ["expandable-chapters"],
3+
"pluginsConfig": {
4+
"fontsettings": {
5+
"theme": "sepia",
6+
"family": "sans",
7+
"size": 2
8+
}
9+
},
10+
"structure" : {
11+
"readme" : "intro.md"
12+
},
13+
"styles": {
14+
"website": "website.css"
15+
},
16+
"author": "ActionTech",
17+
"title": "SQLE manual"
18+
}

docs/website.css

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/* fix https://github.com/GitbookIO/gitbook/issues/1626 */
2+
.markdown-section table {
3+
table-layout: fixed;
4+
display:block;
5+
overflow-x: auto;
6+
}

pdf_adapter.py

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
2+
#!/usr/bin/env python
3+
# _*_ coding:utf-8 _*_
4+
5+
import os
6+
import io
7+
8+
folder_path = "./build"
9+
10+
def fix_alert_tag(file_name):
11+
with io.open(file_name, "r", encoding="utf-8") as f1:
12+
in_alert_body = False
13+
has_alert = False
14+
content = ""
15+
lines = f1.readlines()
16+
for line in lines:
17+
if line.startswith(":::"):
18+
in_alert_body = not in_alert_body
19+
has_alert = True
20+
continue
21+
if in_alert_body:
22+
content = content + "> " + line
23+
else:
24+
content = content + line
25+
26+
if has_alert:
27+
print("fix file " + file_name)
28+
new_file = file_name + ".replace"
29+
with io.open(new_file, "w", encoding="utf-8") as f2:
30+
f2.write(content)
31+
os.remove(file_name)
32+
os.rename(new_file, file_name)
33+
34+
35+
def findAllFile(base):
36+
for root, ds, fs in os.walk(base):
37+
for f in fs:
38+
fullname = os.path.join(root, f)
39+
yield fullname
40+
41+
42+
if __name__ == '__main__':
43+
for file_path in findAllFile(folder_path):
44+
if file_path.startswith(os.path.join(folder_path, "node_modules")):
45+
continue
46+
if file_path.lower().endswith(".md"):
47+
fix_alert_tag(file_path)

0 commit comments

Comments
 (0)