From 38692436dcbb0f0fcc3890c59253c40e64bee770 Mon Sep 17 00:00:00 2001 From: He Wang Date: Mon, 2 Aug 2021 16:17:46 +0800 Subject: [PATCH] modify mkdocs (#278) * remove github workflow * update mkdocs.yml and add mkdocs.md * add site/ to .gitignore * leave requirements.txt in docs/ * update mkdocs.md --- .github/workflows/publish-docs.yaml | 30 ------------------- .gitignore | 3 ++ docs/README.md | 20 ------------- mkdocs.md | 45 +++++++++++++++++++++++++++++ docs/mkdocs.yml => mkdocs.yml | 3 +- 5 files changed, 49 insertions(+), 52 deletions(-) delete mode 100644 .github/workflows/publish-docs.yaml delete mode 100644 docs/README.md create mode 100644 mkdocs.md rename docs/mkdocs.yml => mkdocs.yml (84%) diff --git a/.github/workflows/publish-docs.yaml b/.github/workflows/publish-docs.yaml deleted file mode 100644 index 982cb8857..000000000 --- a/.github/workflows/publish-docs.yaml +++ /dev/null @@ -1,30 +0,0 @@ -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/.gitignore b/.gitignore index 723ac5a4d..6fb302ee6 100644 --- a/.gitignore +++ b/.gitignore @@ -86,6 +86,9 @@ test/tmp test/var *.ccls-cache/ +###### Docs website files +site + ###### Intellij files .idea cmake-build-debug diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index ffabb492b..000000000 --- a/docs/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/mkdocs.md b/mkdocs.md new file mode 100644 index 000000000..a3a149ab9 --- /dev/null +++ b/mkdocs.md @@ -0,0 +1,45 @@ +# Build documentation with MkDocs + +OceanBase documentation is built with [MkDocs](https://www.mkdocs.org/). You can check [`mkdocs.yml`](mkdocs.yml) for more information. + +## Requirements + +Before installing dependencies, please make sure you have installed a recent version of Python 3 and pip. + +Then you can run the following command in your terminal: + + $ pip install -r docs/requirements.txt + +## Build the documentation + +You can build the documentation by running the following command: + + $ mkdocs build + +This will create a new directory to store the output files, which is `site/` by default. + +## Start a server locally + +You can start a server locally by running the following command: + + $ mkdocs serve + +Open up http://127.0.0.1:8000/ in your browser, and you'll see the default home page. + +## Modify pages + +### Edit a page + +If you want to modify the content of a page, you can edit the markdown file in `docs/` directory directly. + +### Modify the layout of pages + +To modify the layout of pages, you need to edit `mkdocs.yml`. + +For configuration details, see [MkDocs User Guide](https://www.mkdocs.org/user-guide/configuration/). + +**Note:** `docs/` is the default value of `docs_dir`, which means `docs/` is equivalent to `./` in `mkdocs.yml`. + +## Contribute + +See [How to contribute](CONTRIBUTING.md). \ No newline at end of file diff --git a/docs/mkdocs.yml b/mkdocs.yml similarity index 84% rename from docs/mkdocs.yml rename to mkdocs.yml index 4483dca7f..23b014b3a 100644 --- a/docs/mkdocs.yml +++ b/mkdocs.yml @@ -2,8 +2,7 @@ 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: