Skip to content

Commit

Permalink
Update docs extensions and workflow (#166)
Browse files Browse the repository at this point in the history
* docs: Update docs requirements

* docs: Remove double section title in toc

* docs: Update emoji extension
  • Loading branch information
MusicDin authored Nov 2, 2023
1 parent 4277532 commit 3bbf89a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 35 deletions.
34 changes: 12 additions & 22 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
# Documentation deployment workflow.
#
# Documentation is always deployed for master and release-* branches.
# In addition, there is a 'latest' alias that points to the version
# of the latest release, which is updated whenever a new release is
# In addition, there is a 'latest' alias that points to the version
# of the latest release, which is updated whenever a new release is
# published.
#
#
name: docs
on:
push:
Expand All @@ -14,7 +14,7 @@ on:
- release-*
tags:
- v*

jobs:
deploy_docs:
name: Deploy documentation
Expand All @@ -25,14 +25,14 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Get latest repository version
id: latest_version
uses: oprypin/find-latest-tag@v1
with:
repository: ${{ github.repository }}
prefix: 'v'

- name: Extract version from branch name
id: branch_version
uses: actions/github-script@v6
Expand All @@ -48,14 +48,14 @@ jobs:
return version.startsWith(prefix) ? version : prefix + version
}
return branch
- name: Shorten tag version
id: tag_version
if: ${{ github.ref_type == 'tag' }}
uses: actions/github-script@v6
env:
TAG_NAME: ${{ github.ref_name }}
with:
with:
result-encoding: string
script: |
version = process.env.TAG_NAME
Expand All @@ -66,12 +66,12 @@ jobs:
echo "BRANCH_VERSION=${{ steps.branch_version.outputs.result }}" >> $GITHUB_ENV
echo "LATEST_VERSION=${{ steps.latest_version.outputs.tag }}" >> $GITHUB_ENV
echo "TAG_VERSION=${{ steps.tag_version.outputs.result }}" >> $GITHUB_ENV
- name: Configure Git user
run: |
git config user.name github-actions
git config user.email [email protected]
- name: Fetch gh-pages repository
run: |
git fetch origin gh-pages --depth=1
Expand All @@ -83,23 +83,13 @@ jobs:

- name: Install Python dependencies
run: |
pip install \
jinja2>=3.1 \
markdown>=3.3 \
mkdocs>=1.4 \
mkdocs-material>=9.0 \
mkdocs-material-extensions>=1.1 \
mkdocs-minify-plugin>=0.6 \
mkdocs-redirects>=1.0 \
pygments>=2.14 \
pymdown-extensions>=9.9 \
mike>=1.1.2
pip install -r docs/requirements.txt
- name: Deploy documentation
if: ${{ github.ref_type == 'branch' }}
run: |
mike deploy --push --update-aliases ${{ env.BRANCH_VERSION }}
- name: Deploy documentation and update alias for latest
if: ${{ github.ref_type == 'tag' && env.LATEST_VERSION == env.BRANCH_VERSION }}
run: |
Expand Down
20 changes: 10 additions & 10 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
jinja2>=3.1
markdown>=3.3
mkdocs>=1.4
mkdocs-material>=9.0
mkdocs-material-extensions>=1.1
mkdocs-minify-plugin>=0.6
mkdocs-redirects>=1.0
pygments>=2.14
pymdown-extensions>=9.9
mike>=1.1.2
jinja2~=3.1
markdown~=3.3
mkdocs~=1.5,>=1.5.3
mkdocs-material~=9.4
mkdocs-material-extensions~=1.3
mkdocs-minify-plugin~=0.6
mkdocs-redirects~=1.0
pygments~=2.16
pymdown-extensions~=10.2
mike~=1.1
5 changes: 4 additions & 1 deletion docs/theme/assets/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@
/* Large screens only */
@media (min-width:1220px) {
/* Left navigation - first non-section title (main title) */
li.md-nav__item:not(.md-nav__item--section) > label.md-nav__link {
li.md-nav__item.md-nav__item--section > label.md-nav__link[id='__nav_1_label'] > span,
li.md-nav__item.md-nav__item--section > label.md-nav__link[id='__nav_2_label'] > span,
li.md-nav__item.md-nav__item--section > label.md-nav__link[id='__nav_3_label'] > span,
li.md-nav__item.md-nav__item--section > label.md-nav__link[id='__nav_4_label'] > span {
height: 0;
}

Expand Down
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ markdown_extensions:

# Emoji
- pymdownx.emoji:
emoji_index: !!python/name:materialx.emoji.twemoji
emoji_generator: !!python/name:materialx.emoji.to_svg # Page tree
emoji_index: !!python/name:material.extensions.emoji.twemoji
emoji_generator: !!python/name:material.extensions.emoji.to_svg # Page tree

# - pymdownx.highlight:
# linenums: true
Expand Down

0 comments on commit 3bbf89a

Please sign in to comment.