Skip to content

Commit 1fda731

Browse files
authored
Merge pull request #184 from pharmaverse/zensical
Migrate from mkdocs-material to zensical
2 parents 144f9e2 + 42487a7 commit 1fda731

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+307
-531
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,27 @@
1-
name: mkdocs
1+
name: Documentation
22

33
on:
44
push:
55
branches:
66
- main
77

88
permissions:
9-
contents: write
9+
contents: read
10+
pages: write
11+
id-token: write
1012

1113
jobs:
1214
deploy:
15+
environment:
16+
name: github-pages
17+
url: ${{ steps.deployment.outputs.page_url }}
1318
runs-on: ubuntu-latest
1419
steps:
20+
- uses: actions/configure-pages@v5
1521
- uses: actions/checkout@v6
16-
- name: Configure Git Credentials
17-
run: |
18-
git config user.name github-actions[bot]
19-
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
20-
2122
- uses: actions/setup-python@v6
2223
with:
2324
python-version: 3.x
24-
- run: echo "cache_id=$(date --utc '+%V')" >> $GITHUB_ENV
25-
26-
- uses: actions/cache@v4
27-
with:
28-
key: mkdocs-material-${{ env.cache_id }}
29-
path: .cache
30-
restore-keys: |
31-
mkdocs-material-
3225

3326
- name: Install ttf-mscorefonts-installer
3427
run: |
@@ -40,23 +33,26 @@ jobs:
4033

4134
- name: Install dependencies
4235
run: |
43-
pip install mkdocs-material mkdocstrings-python markdown-exec[ansi] matplotlib
36+
pip install zensical mkdocstrings-python markdown-exec[ansi]
4437
pip install pytest pytest-cov pytest-r-snapshot
45-
pip install python-docx pypdf
38+
pip install matplotlib python-docx pypdf
4639
pip install -e '.[all]'
47-
pip install --force-reinstall "click<8.2.2" # Workaround for https://github.com/squidfunk/mkdocs-material/issues/8375
4840
49-
- name: Generate coverage report and deploy mkdocs site
41+
- name: Generate coverage report and deploy site
5042
run: |
5143
pytest --cov=rtflite --cov-report=html:docs/coverage/
5244
# Build the site first to generate all artifacts
53-
mkdocs build
45+
zensical build --clean
5446
# Ensure generated artifacts are included
5547
if [ -d "docs/articles/rtf" ]; then
5648
cp -r docs/articles/rtf site/articles/
5749
fi
5850
if [ -d "docs/articles/pdf" ]; then
5951
cp -r docs/articles/pdf site/articles/
6052
fi
61-
# Deploy the built site
62-
mkdocs gh-deploy --force
53+
54+
- uses: actions/upload-pages-artifact@v4
55+
with:
56+
path: site
57+
- uses: actions/deploy-pages@v4
58+
id: deployment

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
- **Composition logic**: Modules such as `encode.py`, `pagination/`, `row.py`, `attributes.py`, and `services/` transform structured data into final RTF output. They make heavy use of Pydantic validators, typed helper classes, and string-building utilities.
1212
- **Font and color utilities**: `fonts/`, `fonts_mapping.py`, `text_convert.py`, `text_conversion/`, and `services/color_service.py` manage font metrics, color lookup, and text normalization.
1313
- **Conversion helpers**: `convert.py` provides integration with LibreOffice for PDF conversion, while shell/python scripts in `scripts/` (e.g., `check_rtf.sh`, `verify_ascii.py`) support validation workflows.
14-
- **Documentation**: `docs/` hosts the MkDocs site. Markdown articles may execute Python snippets via `markdown-exec` during site builds.
14+
- **Documentation**: `docs/` hosts the Zensical site. Markdown articles may execute Python snippets via `markdown-exec` during site builds.
1515

1616
## Development workflow expectations
1717
- Use [uv](https://docs.astral.sh/uv/) for environment management. Run `uv sync` to create/refresh the local virtual environment before developing.
@@ -22,7 +22,7 @@
2222

2323
## Testing & quality gates
2424
- Execute `pytest` (or targeted subsets) before committing. Snapshot-style tests compare normalized RTF output; update fixtures thoughtfully and document rationale when expectations change.
25-
- If functionality affects documentation examples, rebuild the docs locally with `mkdocs build` (or preview via `mkdocs serve`) to confirm rendered outputs.
25+
- If functionality affects documentation examples, rebuild the docs locally with `zensical build --clean` (or preview via `zensical serve`) to confirm rendered outputs.
2626
- Keep dependency metadata (`uv.lock`) in sync when upgrading libraries; use `uv lock --upgrade` followed by `uv sync` if dependency changes are intentional.
2727

2828
## Additional tips

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
### Documentation
6767

6868
- Updated the assembly article to use `concatenate_docx` in code examples and
69-
added a reference page for assemble function to the mkdocs site (#160).
69+
added a reference page for assemble function to the documentation site (#160).
7070

7171
## rtflite 2.2.0
7272

@@ -190,7 +190,7 @@
190190
### Testing
191191

192192
- Added a developer script to compare current RTF outputs with snapshots
193-
generated from mkdocs site articles (#102).
193+
generated from documentation site articles (#102).
194194

195195
### Documentation
196196

CONTRIBUTING.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This will restore the exact versions of Python and dependency packages
3939
under the project's `.venv/` directory:
4040

4141
```bash
42-
uv sync
42+
uv sync --all-extras
4343
```
4444

4545
### Development
@@ -72,25 +72,25 @@ pytest --cov=rtflite --cov-report=html:docs/coverage/
7272

7373
### Documentation
7474

75-
To preview the mkdocs website locally:
75+
To preview the Zensical website locally:
7676

7777
```bash
78-
mkdocs serve
78+
zensical serve
7979
```
8080

81-
To build the mkdocs website locally into `site/`, run:
81+
To build the Zensical website locally into `site/`, run:
8282

8383
```bash
84-
mkdocs build
84+
zensical build --clean
8585
```
8686

8787
rtflite renders vignette-like articles under `docs/articles `using markdown-exec.
88-
This allows mkdocs to render Python code chunks and their outputs when building the site.
88+
This allows Zensical to render Python code chunks and their outputs when building the site.
8989
Check the [markdown-exec documentation](https://pawamoy.github.io/markdown-exec/usage/)
9090
for possible code chunk options.
9191

9292
If you made changes to the `.md` files in the root directory,
93-
make sure to synchronize them to the mkdocs website:
93+
make sure to synchronize them to the Zensical website:
9494

9595
```bash
9696
sh docs/scripts/sync.sh
@@ -128,9 +128,8 @@ uv self update
128128
Update `uv.lock` file regularly:
129129

130130
```bash
131-
uv sync --quiet
132131
uv lock --upgrade
133-
uv sync
132+
uv sync --all-extras
134133
```
135134

136135
### Python version

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![CI tests](https://github.com/pharmaverse/rtflite/actions/workflows/ci-tests.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/ci-tests.yml)
77
[![Mypy check](https://github.com/pharmaverse/rtflite/actions/workflows/mypy.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/mypy.yml)
88
[![Ruff check](https://github.com/pharmaverse/rtflite/actions/workflows/ruff-check.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/ruff-check.yml)
9-
[![mkdocs](https://github.com/pharmaverse/rtflite/actions/workflows/mkdocs.yml/badge.svg)](https://pharmaverse.github.io/rtflite/)
9+
[![Documentation](https://github.com/pharmaverse/rtflite/actions/workflows/docs.yml/badge.svg)](https://pharmaverse.github.io/rtflite/)
1010
![License](https://img.shields.io/pypi/l/rtflite)
1111

1212
Lightweight RTF composer for Python.
135 KB
Binary file not shown.
166 KB
Binary file not shown.

docs/changelog.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
### Documentation
6767

6868
- Updated the assembly article to use `concatenate_docx` in code examples and
69-
added a reference page for assemble function to the mkdocs site (#160).
69+
added a reference page for assemble function to the documentation site (#160).
7070

7171
## rtflite 2.2.0
7272

@@ -190,7 +190,7 @@
190190
### Testing
191191

192192
- Added a developer script to compare current RTF outputs with snapshots
193-
generated from mkdocs site articles (#102).
193+
generated from documentation site articles (#102).
194194

195195
### Documentation
196196

docs/contributing.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ This will restore the exact versions of Python and dependency packages
3939
under the project's `.venv/` directory:
4040

4141
```bash
42-
uv sync
42+
uv sync --all-extras
4343
```
4444

4545
### Development
@@ -72,25 +72,25 @@ pytest --cov=rtflite --cov-report=html:docs/coverage/
7272

7373
### Documentation
7474

75-
To preview the mkdocs website locally:
75+
To preview the Zensical website locally:
7676

7777
```bash
78-
mkdocs serve
78+
zensical serve
7979
```
8080

81-
To build the mkdocs website locally into `site/`, run:
81+
To build the Zensical website locally into `site/`, run:
8282

8383
```bash
84-
mkdocs build
84+
zensical build --clean
8585
```
8686

8787
rtflite renders vignette-like articles under `docs/articles `using markdown-exec.
88-
This allows mkdocs to render Python code chunks and their outputs when building the site.
88+
This allows Zensical to render Python code chunks and their outputs when building the site.
8989
Check the [markdown-exec documentation](https://pawamoy.github.io/markdown-exec/usage/)
9090
for possible code chunk options.
9191

9292
If you made changes to the `.md` files in the root directory,
93-
make sure to synchronize them to the mkdocs website:
93+
make sure to synchronize them to the Zensical website:
9494

9595
```bash
9696
sh docs/scripts/sync.sh
@@ -128,9 +128,8 @@ uv self update
128128
Update `uv.lock` file regularly:
129129

130130
```bash
131-
uv sync --quiet
132131
uv lock --upgrade
133-
uv sync
132+
uv sync --all-extras
134133
```
135134

136135
### Python version

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
[![CI tests](https://github.com/pharmaverse/rtflite/actions/workflows/ci-tests.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/ci-tests.yml)
77
[![Mypy check](https://github.com/pharmaverse/rtflite/actions/workflows/mypy.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/mypy.yml)
88
[![Ruff check](https://github.com/pharmaverse/rtflite/actions/workflows/ruff-check.yml/badge.svg)](https://github.com/pharmaverse/rtflite/actions/workflows/ruff-check.yml)
9-
[![mkdocs](https://github.com/pharmaverse/rtflite/actions/workflows/mkdocs.yml/badge.svg)](https://pharmaverse.github.io/rtflite/)
9+
[![Documentation](https://github.com/pharmaverse/rtflite/actions/workflows/docs.yml/badge.svg)](https://pharmaverse.github.io/rtflite/)
1010
![License](https://img.shields.io/pypi/l/rtflite)
1111

1212
Lightweight RTF composer for Python.

0 commit comments

Comments
 (0)