From 53f7a648885bf1ead7ca403c3d6838220631d19e Mon Sep 17 00:00:00 2001 From: He Wang Date: Fri, 30 Jul 2021 21:15:48 +0800 Subject: [PATCH] add docs website config (#251) * add docs website config * move files in doc/ to docs/ --- .github/workflows/publish-docs.yaml | 30 +++++++++++++++++++ README.md | 2 +- docs/README.md | 20 +++++++++++++ .../cn}/ob-admin/clog-format-introduction.md | 0 {doc-cn => docs/cn}/ob-admin/clog-tool.md | 0 {doc-cn => docs/cn}/quick-start-cn.md | 0 {doc-en => docs/en}/quick-start-en.md | 0 docs/index.md | 3 ++ docs/mkdocs.yml | 10 +++++++ docs/requirements.txt | 10 +++++++ 10 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish-docs.yaml create mode 100644 docs/README.md rename {doc-cn => docs/cn}/ob-admin/clog-format-introduction.md (100%) rename {doc-cn => docs/cn}/ob-admin/clog-tool.md (100%) rename {doc-cn => docs/cn}/quick-start-cn.md (100%) rename {doc-en => docs/en}/quick-start-en.md (100%) create mode 100644 docs/index.md create mode 100644 docs/mkdocs.yml create mode 100644 docs/requirements.txt diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml new file mode 100644 index 0000000000..982cb8857d --- /dev/null +++ b/.github/workflows/publish-docs.yaml @@ -0,0 +1,30 @@ +name: Publish docs via GitHub Pages +on: + push: + branches: + - master + +jobs: + deploy: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: '3.7' + architecture: 'x64' + + - name: Install dependencies + run: | + pip install --upgrade pip + pip install -r docs/requirements.txt + - name: Build + run: mkdocs build -f docs/mkdocs.yml + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.PUBLISH_DOCS_TOKEN }} + publish_dir: site diff --git a/README.md b/README.md index 0cb71e1364..906fe01c3a 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ OceanBase Database supports the entire core business of Alipay and the core syst ## Quick start -Refer to the [Get Started guide](doc/quick-start-en.md) to try out OceanBase Database. +Refer to the [Get Started guide](docs/en/quick-start-en.md) to try out OceanBase Database. ## Documentation diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000000..ffabb492bd --- /dev/null +++ b/docs/README.md @@ -0,0 +1,20 @@ +# OceanBase Documentation +Welcome to the OceanBase documentation! + +This directory stores all the source files of OceanBase documentation website. + +## Starting a server locally + +OceanBase documentation website is built with [MkDocs](https://www.mkdocs.org/). To install all dependencies, run: + + $ pip install -r ./requirements.txt + +Generate the site, and start a server locally: + + $ mkdocs serve + +Open up http://127.0.0.1:8000/ in your browser, and you'll see the default home page. + +## Contributing + +See [How to Contribute](../CONTRIBUTING.md). \ No newline at end of file diff --git a/doc-cn/ob-admin/clog-format-introduction.md b/docs/cn/ob-admin/clog-format-introduction.md similarity index 100% rename from doc-cn/ob-admin/clog-format-introduction.md rename to docs/cn/ob-admin/clog-format-introduction.md diff --git a/doc-cn/ob-admin/clog-tool.md b/docs/cn/ob-admin/clog-tool.md similarity index 100% rename from doc-cn/ob-admin/clog-tool.md rename to docs/cn/ob-admin/clog-tool.md diff --git a/doc-cn/quick-start-cn.md b/docs/cn/quick-start-cn.md similarity index 100% rename from doc-cn/quick-start-cn.md rename to docs/cn/quick-start-cn.md diff --git a/doc-en/quick-start-en.md b/docs/en/quick-start-en.md similarity index 100% rename from doc-en/quick-start-en.md rename to docs/en/quick-start-en.md diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000000..a1d682bdb1 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,3 @@ +# 欢迎使用 OceanBase 文档 + +OceanBase is an enterprise distributed relational database with high availability, high performance, horizontal scalability, and compatibility with SQL standards. \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100644 index 0000000000..4483dca7f7 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,10 @@ +site_name: OceanBase 手册 +repo_url: 'https://github.com/oceanbase/oceanbase' +repo_name: 'OceanBase' +edit_uri: 'edit/master/docs/' +docs_dir: './' +site_dir: '../site' +theme: + name: 'material' +nav: + - Home: 'index.md' diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000000..d7620ffe44 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,10 @@ +mkdocs==1.1.2 +mkdocs-material +mkdocs-macros-plugin +mike +mdx_truly_sane_lists +mkdocs_latest_release_plugin +mkdocs-git-revision-date-localized-plugin +weasyprint +mkdocs-with-pdf +qrcode -- GitLab