From 1d250f0f6284571bd1a13d04c7c5697cbbe02292 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Wed, 19 Jun 2024 19:40:24 +0800 Subject: [PATCH 1/2] update develop mkdocs --- mkdocs.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/mkdocs.yml b/mkdocs.yml index 9afdcb6c7..bdb04bd2d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -181,12 +181,18 @@ plugins: - mkdocstrings: handlers: python: - paths: [./ppsci] + setup_commands: + - import sys + - sys.path.append("../") + paths: [../ppsci] + selection: + new_path_syntax: true - mkdocs-video - git-revision-date-localized: enable_creation_date: true fallback_to_build_date: true type: date + - mike # Extensions markdown_extensions: @@ -235,3 +241,5 @@ extra: - name: English link: /en/ lang: en + version: + provider: mike From 5fe2f2cec62cecf7cc9502dcbbae652d49f7eb64 Mon Sep 17 00:00:00 2001 From: HydrogenSulfate <490868991@qq.com> Date: Wed, 19 Jun 2024 19:48:05 +0800 Subject: [PATCH 2/2] add mike plugin to support deploying document in github pages --- .github/workflows/publish.yml | 38 ----------------------------------- docs/requirements.txt | 1 + mkdocs.yml | 7 +------ 3 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index 1ef6aeee9..000000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Publish Python package - -on: - push: - branches: - - develop # Trigger the workflow on push events to the develop branch - -jobs: - build-and-publish: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.8', '3.9', '3.10'] # List of Python versions - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 0 - - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine build - - - name: Build package - run: | - python -m build - - - name: Publish package - env: - TWINE_USERNAME: __token__ - TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} - run: | - twine upload dist/* diff --git a/docs/requirements.txt b/docs/requirements.txt index 10a2e6064..b859dfb08 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,5 +1,6 @@ Jinja2~=3.1 matplotlib +mike mkdocs mkdocs-autorefs mkdocs-git-revision-date-localized-plugin diff --git a/mkdocs.yml b/mkdocs.yml index bdb04bd2d..4c28197d7 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -181,12 +181,7 @@ plugins: - mkdocstrings: handlers: python: - setup_commands: - - import sys - - sys.path.append("../") - paths: [../ppsci] - selection: - new_path_syntax: true + paths: [./ppsci] - mkdocs-video - git-revision-date-localized: enable_creation_date: true