From 41594a13da092f1d57d0972f065410b9b8863a5e Mon Sep 17 00:00:00 2001 From: Xavier Raynaud Date: Mon, 15 Jan 2024 14:56:31 +0100 Subject: [PATCH] update for doc --- .github/workflows/doc.yml | 32 +++++++++++++++++++++ .github/workflows/update_ghpages.yml | 43 ---------------------------- sphinx/README.org | 10 +------ 3 files changed, 33 insertions(+), 52 deletions(-) create mode 100644 .github/workflows/doc.yml delete mode 100644 .github/workflows/update_ghpages.yml diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml new file mode 100644 index 0000000..b2d7551 --- /dev/null +++ b/.github/workflows/doc.yml @@ -0,0 +1,32 @@ +name: "Sphinx: Render docs" + +on: + push: + branches: [ sphinx ] + +jobs: + build: + + runs-on: ubuntu-latest + + permissions: + contents: write + + steps: + - uses: actions/checkout@v4 + - name: Build HTML + uses: ammaraskar/sphinx-action@master + with: + docs-folder: "sphinx/" + - name: Upload artifacts + uses: actions/upload-artifact@v4 + with: + name: documentationHTML + path: sphinx/_build/html/ + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + if: github.ref == 'refs/heads/dev' + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: sphinx/_build/html + diff --git a/.github/workflows/update_ghpages.yml b/.github/workflows/update_ghpages.yml deleted file mode 100644 index a1f14b7..0000000 --- a/.github/workflows/update_ghpages.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Update GitHub Pages - -on: - push: - branches: - - master # Replace with the branch name you want to trigger the workflow on - -env: - GIT_USER_NAME: BattINFO Developers - GIT_USER_EMAIL: "BattINFO@big-map.org" - -jobs: - updatepages: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v2 - - - name: Set up Python - uses: actions/setup-python@v4 #Uses python install action from here: https://github.com/marketplace?type=actions - with: - python-version: '3.10' # Replace with the desired Python version - - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install Markdown==3.4.3 rdflib==6.3.2 # Add any other dependencies if needed - - - name: Render documentation from ttl - run: python docs/scripts/ttl_to_html.py - - - name: Render documentation from md - run: python docs/scripts/md_to_html.py - - - name: Commit updated documentation - run: | - cd ${GITHUB_WORKSPACE} - git config --global user.email "${GIT_USER_EMAIL}" - git config --global user.name "${GIT_USER_NAME}" - git config pull.rebase false - git add . - git commit -m "Automatic update of github pages" - git push origin master diff --git a/sphinx/README.org b/sphinx/README.org index 5c91b13..c06cd20 100644 --- a/sphinx/README.org +++ b/sphinx/README.org @@ -5,7 +5,7 @@ #+begin_src pip install sphinx #+end_src -** install sphinx rtd theme +** install sphinx pydata theme https://pydata-sphinx-theme.readthedocs.io/en/latest/index.html #+begin_src pip install pydata-sphinx-theme @@ -14,14 +14,6 @@ #+begin_src pip install sphinxcontrib-globalsubs #+end_src -** youtube - #+begin_src shell - pip install sphinxcontrib-youtube - #+end_src -** collapse - #+begin_src shell - python -m pip install sphinx_collapse - #+end_src ** autosectionlabel - part of default distribution - We use ~autosectionlabel_prefix_document = True~ which means that the internal link must be prefixed by the file