Skip to content

Commit 7c20c80

Browse files
committed
Migrate documentation to use Zensical instead of MkDocs
For now leave the configuration in mkdocs.yml. TODO later: Migrate configuration to zensical.toml
1 parent 2352d7f commit 7c20c80

File tree

10 files changed

+37
-40
lines changed

10 files changed

+37
-40
lines changed

.github/CONTRIBUTING.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,17 @@ for a list of dependencies needed for building `cmd2`.
9393
See the `dev` list under the `[dependency-groups]` heading in [pyproject.toml](../pyproject.toml)
9494
for a list of dependencies needed for building `cmd2`.
9595

96-
| Prerequisite | Minimum Version | Purpose |
97-
| -------------------------------------------------------------------- | --------------- | -------------------------------- |
98-
| [codecov](http://doc.pytest.org/en/latest/) | `2.1.13` | Cover coverage reporting |
99-
| [mypy](https://mypy-lang.org/) | `1.13.0` | Static type checker |
100-
| [pytest](https://docs.pytest.org/en/stable/) | `3.0.6` | Unit and integration tests |
101-
| [pytest-cov](http://doc.pytest.org/en/latest/) | `6.0.0` | Pytest code coverage |
102-
| [pytest-mock](https://pypi.org/project/pytest-mock/) | `3.14.0` | Pytest mocker fixture |
103-
| [mkdocs-macros-plugin](https://mkdocs-macros-plugin.readthedocs.io/) | `1.3.7` | MkDocs Plugin for macros |
104-
| [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) | `9.5.49` | Documentation |
105-
| [mkdocstrings[python]](https://mkdocstrings.github.io/) | `0.27.0` | MkDocs Plugin for Python AutoDoc |
106-
| [ruff](https://github.com/astral-sh/ruff) | `0.7.3` | Fast linter and formatter |
107-
| [uv](https://github.com/astral-sh/uv) | `0.5.1` | Python package management |
96+
| Prerequisite | Minimum Version | Purpose |
97+
| ------------------------------------------------------- | --------------- | ---------------------------------- |
98+
| [codecov](http://doc.pytest.org/en/latest/) | `2.1.13` | Cover coverage reporting |
99+
| [mypy](https://mypy-lang.org/) | `1.13.0` | Static type checker |
100+
| [pytest](https://docs.pytest.org/en/stable/) | `3.0.6` | Unit and integration tests |
101+
| [pytest-cov](http://doc.pytest.org/en/latest/) | `6.0.0` | Pytest code coverage |
102+
| [pytest-mock](https://pypi.org/project/pytest-mock/) | `3.14.0` | Pytest mocker fixture |
103+
| [mkdocstrings[python]](https://mkdocstrings.github.io/) | `0.27.0` | Zensical plugin for Python AutoDoc |
104+
| [ruff](https://github.com/astral-sh/ruff) | `0.7.3` | Fast linter and formatter |
105+
| [uv](https://github.com/astral-sh/uv) | `0.5.1` | Python package management |
106+
| [Zensical](https://github.com/zensical/zensical) | `0.0.17` | Markdown-based documentation |
108107

109108
If Python is already installed in your machine, run the following commands to validate the versions:
110109

@@ -351,8 +350,8 @@ are primarily related to continuous integration and release deployment.
351350

352351
#### Changes to the documentation files
353352

354-
If you made changes to any file in the `/docs` directory, you need to build the MkDocs documentation
355-
and make sure your changes look good:
353+
If you made changes to any file in the `/docs` directory, you need to build the Zensical
354+
documentation and make sure your changes look good:
356355

357356
```sh
358357
$ make docs-test

.github/workflows/docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ jobs:
2727
python-version: "3.14"
2828
- name: Install the project
2929
run: uv sync --group docs
30-
- name: Check if the MkDocs documentation can be built
31-
run: uv run mkdocs build -s
30+
- name: Check if the Zensical documentation can be built
31+
run: uv run zensical build -s

.prettierignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# Markdown documentation files with non-standards syntax for mkdocstrings that Prettier should not auto-format
1+
# Markdown documentation files with non-standard syntax for mkdocstrings that Prettier should not auto-format
22
docs/features/initialization.md

.readthedocs.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Read the Docs configuration file for MkDocs projects
2-
# See https://docs.readthedocs.io/en/stable/intro/mkdocs.html for details
1+
# Read the Docs configuration file for Zensical projects
2+
# See https://docs.readthedocs.com/platform/stable/intro/zensical.html for details
33

44
# Required
55
version: 2
@@ -10,17 +10,19 @@ version: 2
1010
# - epub
1111
formats: all
1212

13-
# Build documentation in the "docs/" directory with MkDocs
14-
mkdocs:
15-
configuration: mkdocs.yml
16-
1713
# Set the OS, Python version and other tools you might need
1814
build:
1915
os: ubuntu-24.04
2016
tools:
21-
python: "3.13"
17+
python: latest
2218
jobs:
2319
install:
2420
- pip install .
2521
- pip install dependency-groups
2622
- pip-install-dependency-groups docs
23+
build:
24+
html:
25+
- zensical build
26+
post_build:
27+
- mkdir -p $READTHEDOCS_OUTPUT/html/
28+
- cp --recursive site/* $READTHEDOCS_OUTPUT/html/

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ test: ## Test the code with pytest.
4040

4141
.PHONY: docs-test
4242
docs-test: ## Test if documentation can be built without warnings or errors
43-
@uv run mkdocs build -s
43+
@uv run zensical build -s
4444

4545
.PHONY: docs
4646
docs: ## Build and serve the documentation
47-
@uv run mkdocs serve
47+
@uv run zensical serve
4848

4949
.PHONY: build
5050
build: clean-build ## Build wheel file

docs/doc_conventions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ See the [Links](https://www.markdownguide.org/basic-syntax/) Markdown syntax doc
6262

6363
## API Documentation
6464

65-
The API documentation is mostly pulled from docstrings in the source code using the MkDocs
65+
The API documentation is mostly pulled from docstrings in the source code using the Zensical
6666
[mkdocstrings](https://mkdocstrings.github.io/) plugin.
6767

6868
When using `mkdocstrings`, it must be preceded by a blank line before and after, i.e.:

docs/features/argument_processing.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ example to learn more about how to use the various `cmd2` argument processing de
2727
`cmd2` provides the following [decorators](../api/decorators.md) for assisting with parsing
2828
arguments passed to commands:
2929

30-
- `cmd2.decorators.with_argparser`
31-
- `cmd2.decorators.with_argument_list`
30+
- [cmd2.decorators.with_argparser][]
31+
- [cmd2.decorators.with_argument_list][]
3232

3333
All of these decorators accept an optional **preserve_quotes** argument which defaults to `False`.
3434
Setting this argument to `True` is useful for cases where you are passing the arguments to another

docs/javascripts/readthedocs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
document.addEventListener("DOMContentLoaded", function (event) {
2-
// Trigger Read the Docs' search addon instead of Material MkDocs default
2+
// Trigger Read the Docs' search addon instead of Zensical default
33
document.querySelector(".md-search__input").addEventListener("focus", (e) => {
44
const event = new CustomEvent("readthedocs-search-show");
55
document.dispatchEvent(event);

docs/migrating/minimum.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Minimum Required Changes
22

3-
[cmd2.Cmd][] subclasses [cmd.Cmd](https://docs.python.org/3/library/cmd.html#cmd.Cmd) from the
4-
standard library, and overrides all of the methods other than `Cmd.emptyline` (`cmd2` never calls
5-
this method). Most apps based on the standard library can be migrated to `cmd2` in just a couple of
6-
minutes.
3+
[cmd2.Cmd][] provides all of the same public methods and fields of
4+
[cmd.Cmd](https://docs.python.org/3/library/cmd.html#cmd.Cmd) from the standard library other than
5+
`Cmd.emptyline` (`cmd2` never calls this method). Most apps based on the standard library can be
6+
migrated to `cmd2` in just a couple of minutes.
77

88
## Import and Inheritance
99

pyproject.toml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,8 @@ dependencies = [
4040
[dependency-groups]
4141
build = ["build>=1.2.2", "setuptools>=80.7.1", "setuptools-scm>=9.2"]
4242
dev = [
43-
"black>=25",
4443
"codecov>=2.1",
4544
"ipython>=8.23",
46-
"mkdocs-git-revision-date-localized-plugin>=1.5",
47-
"mkdocs-material>=9.7.1",
4845
"mkdocstrings[python]>=1",
4946
"mypy>=1.13",
5047
"pre-commit>=3",
@@ -53,14 +50,13 @@ dev = [
5350
"pytest-mock>=3.14.1",
5451
"ruff>=0.14.10",
5552
"uv-publish>=1.3",
53+
"zensical>=0.0.17",
5654
]
5755
docs = [
58-
"black>=25",
59-
"mkdocs-git-revision-date-localized-plugin>=1.5",
60-
"mkdocs-material>=9.7.1",
6156
"mkdocstrings[python]>=1",
6257
"setuptools>=80.7.1",
6358
"setuptools_scm>=8",
59+
"zensical>=0.0.17",
6460
]
6561
quality = ["pre-commit>=3"]
6662
test = [

0 commit comments

Comments
 (0)