From 0abbcfbab47df5538df6dfe36b6d58fa6e154dc7 Mon Sep 17 00:00:00 2001 From: qwahzi Date: Wed, 22 Nov 2023 12:53:53 -0600 Subject: [PATCH] Mkdocs updates to allow community PRs to pass the build.yml check/workflow (#690) * Update Dockerfile to use mkdocs-material Update Dockerfile to use mkdocs-material * Update build.yml for mkdocs Update build.yml for mkdocs * Update requirements.txt with mkdocs & dependencies Update requirements.txt with mkdocs & dependencies * Update publish-docker-pr.yml for mkdocs Update publish-docker-pr.yml for mkdocs * Update publish-docker-master.yml with mkdocs Update publish-docker-master.yml with mkdocs * Update deprecated mkdocs.yml options (#691) Fixing mkdocs build --strict issues: INFO - DeprecationWarning: 'materialx.emoji.twemoji' is deprecated. Material emoji logic has been officially moved into mkdocs-material version 9.4. Please use Material's 'material.extensions.emoji.twemoji' as mkdocs_material_extensions is deprecated and will no longer be supported moving forward. This is the last release. File "/home/default/.local/lib/python3.10/site-packages/materialx/emoji.py", line 106, in twemoji return _patch_index(options) File "/home/default/.local/lib/python3.10/site-packages/materialx/emoji.py", line 59, in _deprecated_func warnings.warn( WARNING - Material emoji logic has been officially moved into mkdocs-material version 9.4. Please use Material's 'material.extensions.emoji.twemoji' as mkdocs_material_extensions is deprecated and will no longer be supported moving forward. This is the last release. WARNING - Config value 'plugins': Plugin 'material/social' option 'cards_color': Deprecated, use 'cards_layout_options.background_color' and 'cards_layout_options.color' with 'default' layout * Update requirements.txt with material[imaging] Update requirements.txt with material[imaging] * Update publish-docker-pr.yml w/ mkdocs change Testing mkdocs workflow change * Update Dockerfile mkdocs Update Dockerfile mkdocs * Update Dockerfile w/ pip upgrade Update Dockerfile w/ pip upgrade * Update Dockerfile pip commands Update Dockerfile pip commands * Update publish-docker-master.yml Fixing mistake * Remove extra pip install on deploy-staging.yml Remove extra pip install on deploy-staging.yml to mirror the publish workflows * Remove extra pip install on deploy.yml Remove extra pip install on deploy.yml to mirror publish workflows * Update Dockerfile to squidfunk/mkdocs-material Update Dockerfile to squidfunk/mkdocs-material * Update publish-docker-master.yml with squidfunk/mkdocs-material:latest Update publish-docker-master.yml with squidfunk/mkdocs-material:latest * Update publish-docker-pr.yml with Update publish-docker-master.yml with squidfunk/mkdocs-material:latest Update publish-docker-pr.yml with Update publish-docker-master.yml with squidfunk/mkdocs-material:latest * Remove old theme info from readme.md Remove old theme info from readme.md * Update Dockerfile to use digest Update Dockerfile to use digest * Update publish-docker-pr.yml to use digest Update image to use digest * Update publish-docker-master.yml to use digest Use sha256 digest --- .github/workflows/build.yml | 1 - .github/workflows/deploy-staging.yml | 1 - .github/workflows/deploy.yml | 1 - .github/workflows/publish-docker-master.yml | 4 ++-- .github/workflows/publish-docker-pr.yml | 4 ++-- Dockerfile | 5 +++-- mkdocs.yml | 8 ++++---- readme.md | 6 ------ requirements.txt | 6 ++++-- 9 files changed, 15 insertions(+), 21 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4488046b0..ccd3ab021 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,6 @@ jobs: with: python-version: 3.x - run: pip install -r requirements.txt - - run: pip install ${{ secrets.MKDOCS_RESOURCES }} - run: mkdocs build --strict env: diff --git a/.github/workflows/deploy-staging.yml b/.github/workflows/deploy-staging.yml index 13e56b8c7..c00019bdb 100644 --- a/.github/workflows/deploy-staging.yml +++ b/.github/workflows/deploy-staging.yml @@ -19,7 +19,6 @@ jobs: key: ${{ github.ref }} path: .cache - run: pip install -r requirements.txt - - run: pip install ${{ secrets.MKDOCS_RESOURCES }} - run: mkdocs gh-deploy --force env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2cad883ee..a93f45ad9 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -18,7 +18,6 @@ jobs: key: ${{ github.ref }} path: .cache - run: pip install -r requirements.txt - - run: pip install ${{ secrets.MKDOCS_RESOURCES }} - run: mkdocs gh-deploy --force env: GH_TOKEN: ${{ secrets.GH_TOKEN }} diff --git a/.github/workflows/publish-docker-master.yml b/.github/workflows/publish-docker-master.yml index b3b226b5e..669abdfc2 100644 --- a/.github/workflows/publish-docker-master.yml +++ b/.github/workflows/publish-docker-master.yml @@ -15,6 +15,6 @@ jobs: # Build and test Docker image - run: | echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u nanocurrency --password-stdin - docker pull ghcr.io/nanocurrency/mkdocs-material-insiders:latest + docker pull squidfunk/mkdocs-material:9.4.10@sha256:01605a03397a654b74b9de3157f56915d1e075e2d3bd22fcf3fb82c443553c25 docker build -t ghcr.io/nanocurrency/nano-docs:latest . - docker push ghcr.io/nanocurrency/nano-docs:latest \ No newline at end of file + docker push ghcr.io/nanocurrency/nano-docs:latest diff --git a/.github/workflows/publish-docker-pr.yml b/.github/workflows/publish-docker-pr.yml index 5da6d78c9..5e62b68dd 100644 --- a/.github/workflows/publish-docker-pr.yml +++ b/.github/workflows/publish-docker-pr.yml @@ -15,6 +15,6 @@ jobs: # Build and test Docker image - run: | echo ${{ secrets.GHCR_TOKEN }} | docker login ghcr.io -u nanocurrency --password-stdin - docker pull ghcr.io/nanocurrency/mkdocs-material-insiders:latest + docker pull squidfunk/mkdocs-material:9.4.10@sha256:01605a03397a654b74b9de3157f56915d1e075e2d3bd22fcf3fb82c443553c25 docker build -t ghcr.io/nanocurrency/nano-docs:pr-${{ env.PR_NUMBER }} . - docker push ghcr.io/nanocurrency/nano-docs:pr-${{ env.PR_NUMBER }} \ No newline at end of file + docker push ghcr.io/nanocurrency/nano-docs:pr-${{ env.PR_NUMBER }} diff --git a/Dockerfile b/Dockerfile index 20cb7d0aa..013d790c7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM ghcr.io/nanocurrency/mkdocs-material-insiders:latest +FROM squidfunk/mkdocs-material:9.4.10@sha256:01605a03397a654b74b9de3157f56915d1e075e2d3bd22fcf3fb82c443553c25 # Set build directory #WORKDIR /docs @@ -7,6 +7,7 @@ FROM ghcr.io/nanocurrency/mkdocs-material-insiders:latest COPY ./ /docs RUN \ + pip install --upgrade pip && \ pip install -r /docs/requirements.txt # Set working directory @@ -17,4 +18,4 @@ EXPOSE 8000 # Start development server by default ENTRYPOINT ["mkdocs"] -CMD ["serve", "--dev-addr=0.0.0.0:8000"] \ No newline at end of file +CMD ["serve", "--dev-addr=0.0.0.0:8000"] diff --git a/mkdocs.yml b/mkdocs.yml index 25214ea0d..42dd6fcbe 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -121,7 +121,7 @@ markdown_extensions: - pymdownx.critic - pymdownx.details - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji + emoji_index: !!python/name:material.extensions.emoji.twemoji emoji_generator: !!python/name:pymdownx.emoji.to_svg - pymdownx.highlight - pymdownx.inlinehilite @@ -191,9 +191,9 @@ plugins: separator: '[\s\-,:!=\[\]()"/]+|(?!\b)(?=[A-Z][a-z])|\.(?!\d)|&[lg]t;' - social: cards: !ENV [ PRODUCTION, FALSE ] - cards_color: - fill: "#20204c" - text: "#FFFFFF" + cards_layout_options: + background_color: "#20204c" + color: "#FFFFFF" - redirects: redirect_maps: 'running-a-node/rocksdb-ledger-backend.md': 'running-a-node/ledger-management.md' diff --git a/readme.md b/readme.md index 5391f13b7..e6ebc6f24 100644 --- a/readme.md +++ b/readme.md @@ -35,12 +35,6 @@ Note that because a local volume isn't being mounted this pull request review ap Access the site at http://localhost:8000. This supports automatic rebuilding, so anytime changes are saved to the documentation or configuration, it will be rebuilt and refresh the page. Some search indexing may remain cache between builds. -## Theme - -We sponsor the developer of this theme on GitHub ([@squidfunk](https://github.com/squidfunk)) in order to get access to special features of the [Insiders](https://squidfunk.github.io/mkdocs-material-insiders/) version. Our [@nano-infrastructure](https://github.com/nano-infrastructure) account has the permissions to the private repository for that Insiders theme and using a personal access token in the GitHub deployment workflow (set as a GitHub secret in this repository), the theme is pulled down as part of deployment. - -Those developing locally may not have access to some of the special features of this insider theme, but most changes done by external contributors do not need the special theme - changes are backwards compatible with the regular theme. If you need access to the Insiders theme please contact the Nano core team. - ## Formatting and Organization Tips ## Title and description diff --git a/requirements.txt b/requirements.txt index 779d7e323..13445c0e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,5 @@ # Direct dependencies -mkdocs-material-extensions>=1.0 -mkdocs-redirects>=1.0.0 \ No newline at end of file +mkdocs>=1.5 +mkdocs-material[imaging]>=9.4 +mkdocs-material-extensions>=1.3 +mkdocs-redirects>=1.2