Skip to content

Commit

Permalink
Mkdocs updates to allow community PRs to pass the build.yml check/wor…
Browse files Browse the repository at this point in the history
…kflow (#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
  • Loading branch information
qwahzi authored Nov 22, 2023
1 parent 5048e23 commit 0abbcfb
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 21 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
1 change: 0 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
docker push ghcr.io/nanocurrency/nano-docs:latest
4 changes: 2 additions & 2 deletions .github/workflows/publish-docker-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
docker push ghcr.io/nanocurrency/nano-docs:pr-${{ env.PR_NUMBER }}
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand All @@ -17,4 +18,4 @@ EXPOSE 8000

# Start development server by default
ENTRYPOINT ["mkdocs"]
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
CMD ["serve", "--dev-addr=0.0.0.0:8000"]
8 changes: 4 additions & 4 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'
Expand Down
6 changes: 0 additions & 6 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Direct dependencies
mkdocs-material-extensions>=1.0
mkdocs-redirects>=1.0.0
mkdocs>=1.5
mkdocs-material[imaging]>=9.4
mkdocs-material-extensions>=1.3
mkdocs-redirects>=1.2

0 comments on commit 0abbcfb

Please sign in to comment.