From 4c09198a17ed99cf340444ee61f410a88b22c978 Mon Sep 17 00:00:00 2001 From: Martin Todorov Date: Sat, 9 Nov 2024 23:02:29 +0200 Subject: [PATCH] docs: Update mkocs and add dark mode. (#802) --- .github/workflows/docs.yaml | 15 ++++-- README.md | 2 +- .../content/contributing/legal/license-MIT.md | 1 + docs/content/index.md | 3 +- docs/docker-compose.yml | 4 +- docs/docs.Dockerfile | 2 +- docs/mkdocs.yml | 49 +++++++++++++++---- docs/requirements.txt | 22 ++++----- docs/theme/assets/custom.css | 2 - 9 files changed, 70 insertions(+), 30 deletions(-) diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index de2b9e95..82f13862 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -42,7 +42,16 @@ jobs: with: ref: ${{ github.event.pull_request.head.sha || github.sha }} - - name: Build docks + - name: Get current branch name + id: get_branch + run: | + if [ "${{ github.event_name }}" == "pull_request_target" ]; then + echo "branch_name=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV + else + echo "branch_name=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV + fi + + - name: Build docs working-directory: docs run: docker compose run build @@ -54,8 +63,8 @@ jobs: NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} run: | npm install -g netlify - is_master=${{ github.ref_name == 'master' }} - is_fork=${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != vars.CURRENT_REPO && 'true' || 'false' }} + is_master=${{ env.get_branch == 'master' }} + is_fork=${{ github.event.pull_request.head.repo.fork == true }} [[ "$is_master" == "true" && "$is_fork" == "false" ]] && args=" --prod " netlify deploy -d site/ $args | tee build.log url=$(cat build.log | grep -iE "website(.+)url" | cut -f 2- -d":" | xargs) diff --git a/README.md b/README.md index 757ac303..c95f148c 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ We aim to support only the latest LTS versions. At the moment this includes: * JDK 17 * JDK 21 -Please note that although we support JDK 8 we have plans to drop it in one of our next **major** release (most likely `v2.0.0`). +Please note that although we support JDK 8 we have plans to drop it in one of our next **major** release. ## Documentation diff --git a/docs/content/contributing/legal/license-MIT.md b/docs/content/contributing/legal/license-MIT.md index 09e6e91b..60c37f81 100644 --- a/docs/content/contributing/legal/license-MIT.md +++ b/docs/content/contributing/legal/license-MIT.md @@ -3,6 +3,7 @@ This is our copy of the MIT license. ## License Text + ``` --8<-- "../LICENSE.MIT.md" ``` diff --git a/docs/content/index.md b/docs/content/index.md index 080421b9..1a96b0ec 100644 --- a/docs/content/index.md +++ b/docs/content/index.md @@ -1,4 +1,4 @@ -{! ../../README.md [ln:19-37] !} +{! ../../README.md [ln:19-47] !} ## Installation @@ -49,6 +49,7 @@ Create/load a properties file in your project which defines the following properties: ``` + --8<-- "../src/test/resources/amazon-test-sample.properties" ``` diff --git a/docs/docker-compose.yml b/docs/docker-compose.yml index dbef2d7a..3bc6ab7a 100644 --- a/docs/docker-compose.yml +++ b/docs/docker-compose.yml @@ -4,7 +4,7 @@ services: build: context: . dockerfile: ./docs.Dockerfile - image: squidfunk/mkdocs-material:5.5.9-custom + image: squidfunk/mkdocs-material:9.5.44-custom container_name: s3fs-nio-docs working_dir: /workspace/docs volumes: @@ -15,7 +15,7 @@ services: build: context: . dockerfile: ./docs.Dockerfile - image: squidfunk/mkdocs-material:5.5.9-custom + image: squidfunk/mkdocs-material:9.5.44-custom working_dir: /workspace/docs command: [ "build" ] volumes: diff --git a/docs/docs.Dockerfile b/docs/docs.Dockerfile index c15069ea..96db9b6e 100644 --- a/docs/docs.Dockerfile +++ b/docs/docs.Dockerfile @@ -1,4 +1,4 @@ -FROM squidfunk/mkdocs-material:5.5.9 +FROM squidfunk/mkdocs-material:9.5.44 WORKDIR /workspace/docs COPY requirements.txt /workspace/docs diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml index f890e9b5..53432388 100644 --- a/docs/mkdocs.yml +++ b/docs/mkdocs.yml @@ -8,23 +8,50 @@ docs_dir: content theme: name: material custom_dir: 'theme' - icon: - repo: fontawesome/brands/github-alt + icons: + repo: fontawesome/brands/github + fontawesome: true font: text: Roboto code: Roboto Mono + palette: + # Palette toggle for light mode + - scheme: default + media: "(prefers-color-scheme: light)" + primary: indigo + toggle: + icon: material/toggle-switch + name: Switch to dark mode + + # Palette toggle for dark mode + - scheme: slate + media: "(prefers-color-scheme: dark)" + toggle: + icon: material/toggle-switch-off-outline + name: Switch to light mode + features: - - search.highlight + - announce.dismiss + - content.tooltips - meta - # Instant should be disabled because of a bug - not redirecting pages. - #- instant + - navigation.footer + #- navigation.indexes + - navigation.instant + #- navigation.sections + - navigation.tabs + - navigation.tabs.sticky + - navigation.top + - navigation.tracking + - search.highlight + - search.share + - search.suggest - tabs plugins: - search: - prebuild_index: false + prebuild: false lang: - en # - mkdocs-pom-parser-plugin: @@ -39,7 +66,9 @@ plugins: markdown_extensions: - admonition - attr_list + - footnotes - meta + - md_in_html - mdx_gh_links - mdx_include: base_path: ./content @@ -62,8 +91,8 @@ markdown_extensions: - pymdownx.critic - pymdownx.details - pymdownx.emoji: - emoji_index: !!python/name:materialx.emoji.twemoji - emoji_generator: !!python/name:materialx.emoji.to_svg + emoji_generator: !!python/name:material.extensions.emoji.to_svg + emoji_index: !!python/name:material.extensions.emoji.twemoji - pymdownx.highlight - pymdownx.inlinehilite - pymdownx.keys @@ -75,8 +104,10 @@ markdown_extensions: - pymdownx.smartsymbols - pymdownx.snippets: check_paths: true + restrict_base_path: False - pymdownx.superfences - - pymdownx.tabbed + - pymdownx.tabbed: + alternate_style: true - pymdownx.tasklist: custom_checkbox: true - pymdownx.tilde diff --git a/docs/requirements.txt b/docs/requirements.txt index 04dda8fd..ea25dde9 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,14 +1,14 @@ -mkdocs==1.1.2 -mkdocs-material==5.5.11 -mdx_gh_links==0.3 -#mdx_include==1.3.3 +mkdocs~=1.6 +mkdocs-material==9.5.44 +mkdocs-material-extensions~=1.3 +mdx_gh_links==0.4 mdx_include==1.4.2 -mkdocs-markdownextradata-plugin==0.2.1 -mkdocs-git-revision-date-plugin==0.3 -mkdocs-redirects==1.0.1 -mkdocs-htmlproofer-plugin==0.0.3 -mkdocs-pom-parser-plugin>=1.0.3 -mkdocs-minify-plugin==0.3.0 +mdx_include==1.4.2 +mkdocs-markdownextradata-plugin==0.2.5 +mkdocs-git-revision-date-plugin==0.3.2 +mkdocs-redirects==1.2.1 +mkdocs-htmlproofer-plugin==1.2.1 +mkdocs-minify-plugin==0.8.0 # This dependency is necessary for older mkdocs versions. # TODO: Remove when upgrading mkdocs. -jinja2<3.1.0 +jinja2~=3.0 diff --git a/docs/theme/assets/custom.css b/docs/theme/assets/custom.css index b802545b..9ae5ea2f 100644 --- a/docs/theme/assets/custom.css +++ b/docs/theme/assets/custom.css @@ -26,13 +26,11 @@ } .md-typeset table:not([class]) td small:before { - content: '\a'; white-space: pre-wrap; } .md-typeset table:not([class]) td small { font-size: 85%; - color: rgba(0,0,0,0.65); } .md-typeset .md-typeset__table {