Skip to content

docs: Update mkdocs and add dark mode #802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/content/contributing/legal/license-MIT.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
This is our copy of the MIT license.

## License Text

```
--8<-- "../LICENSE.MIT.md"
```
3 changes: 2 additions & 1 deletion docs/content/index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{! ../../README.md [ln:19-37] !}
{! ../../README.md [ln:19-47] !}

## Installation

Expand Down Expand Up @@ -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"
```

Expand Down
4 changes: 2 additions & 2 deletions docs/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/docs.Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
49 changes: 40 additions & 9 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -39,7 +66,9 @@ plugins:
markdown_extensions:
- admonition
- attr_list
- footnotes
- meta
- md_in_html
- mdx_gh_links
- mdx_include:
base_path: ./content
Expand All @@ -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
Expand All @@ -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
Expand Down
22 changes: 11 additions & 11 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
2 changes: 0 additions & 2 deletions docs/theme/assets/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading