Skip to content

Commit df98fb3

Browse files
committed
Convert from Sphinx and reStructuredText to MkDocs and Markdown for documentation
TODO: 1. Finish correcting translation - I stopped at features/disable_commands 2. Get all the autodoc API stuff working properly 3. Get ReadTheDocs working properly
1 parent 69aa9af commit df98fb3

File tree

138 files changed

+4901
-7098
lines changed

Some content is hidden

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

138 files changed

+4901
-7098
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ cmd2/table_creator.py @kmvanbrunt
4141
cmd2/transcript.py @kotfu
4242
cmd2/utils.py @tleonhardt @kotfu @kmvanbrunt
4343

44-
# Sphinx documentation
44+
# Documentation
4545
docs/* @tleonhardt @kotfu
4646

4747
# Examples

.github/CONTRIBUTING.md

Lines changed: 50 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ We welcome pull requests from cmd2 users and seasoned Python developers alike! F
1111

1212
Remember to feel free to ask for help by leaving a comment within the Issue.
1313

14-
Working on your first pull request? You can learn how from the
14+
Working on your first pull request? You can learn how from the
1515
[GitHub Docs](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request).
1616

1717
###### If you've found a bug that is not on the board, [follow these steps](../README.md#found-a-bug).
1818

19-
--------------------------------------------------------------------------------
19+
---
2020

2121
## Contribution guidelines
2222

@@ -46,39 +46,37 @@ The tables below list all prerequisites along with the minimum required version
4646
4747
#### Prerequisites to run cmd2 applications
4848

49-
| Prerequisite | Minimum Version |
50-
|------------------------------------------------------|-----------------|
51-
| [python](https://www.python.org/downloads/) | `3.8` |
52-
| [pyperclip](https://github.com/asweigart/pyperclip) | `1.8.2` |
53-
| [wcwidth](https://pypi.python.org/pypi/wcwidth) | `0.2.12` |
49+
| Prerequisite | Minimum Version |
50+
| --------------------------------------------------- | --------------- |
51+
| [python](https://www.python.org/downloads/) | `3.8` |
52+
| [pyperclip](https://github.com/asweigart/pyperclip) | `1.8.2` |
53+
| [wcwidth](https://pypi.python.org/pypi/wcwidth) | `0.2.12` |
5454

5555
#### Additional prerequisites to build and publish cmd2
5656

5757
| Prerequisite | Minimum Version |
58-
|----------------------------------------------------------|-----------------|
58+
| -------------------------------------------------------- | --------------- |
5959
| [build](https://pypi.org/project/build/) | `1.2.2` |
6060
| [setuptools](https://pypi.org/project/setuptools/) | `72.1.0` |
6161
| [setuptools-scm](https://github.com/pypa/setuptools-scm) | `8.0.4` |
6262
| [twine](https://github.com/pypa/twine) | `5.1.1` |
6363

6464
#### Additional prerequisites for developing cmd2
6565

66-
| Prerequisite | Minimum Version | Purpose |
67-
|----------------------------------------------------------------------|-----------------|----------------------------|
68-
| [codecov](http://doc.pytest.org/en/latest/) | `2.1.13` | Cover coverage reporting |
69-
| [doc8](https://github.com/PyCQA/doc8) | `1.1.2` | Sphinx style checker |
70-
| [invoke](https://www.pyinvoke.org/) | `2.2.0` | Command automation |
71-
| [mypy](https://mypy-lang.org/) | `1.13.0` | Static type checker |
72-
| [pytest](https://docs.pytest.org/en/stable/) | `3.0.6` | Unit and integration tests |
73-
| [pytest-cov](http://doc.pytest.org/en/latest/) | `6.0.0` | Pytest code coverage |
74-
| [pytest-mock](https://pypi.org/project/pytest-mock/) | `3.14.0` | Pytest mocker fixture |
75-
| [sphinx](https://www.sphinx-doc.org/en/master/) | `8.1.3` | Documentation |
76-
| [sphinx-autobuild](hhttps://pypi.org/project/sphinx-autobuild/) | `2024.10.3` | Rebuild docs on changes |
77-
| [sphinx-rtd-theme](https://github.com/readthedocs/sphinx_rtd_theme ) | `3.0.1` | Sphinx theme for RTD |
78-
| [ruff](https://github.com/astral-sh/ruff) | `0.7.3` | Fast linter and formatter |
79-
| [uv](https://github.com/astral-sh/uv) | `0.5.1` | Python package management |
80-
81-
66+
| Prerequisite | Minimum Version | Purpose |
67+
| ------------------------------------------------------------------------------------------ | --------------- | --------------------------------- |
68+
| [codecov](http://doc.pytest.org/en/latest/) | `2.1.13` | Cover coverage reporting |
69+
| [invoke](https://www.pyinvoke.org/) | `2.2.0` | Command automation |
70+
| [mypy](https://mypy-lang.org/) | `1.13.0` | Static type checker |
71+
| [pytest](https://docs.pytest.org/en/stable/) | `3.0.6` | Unit and integration tests |
72+
| [pytest-cov](http://doc.pytest.org/en/latest/) | `6.0.0` | Pytest code coverage |
73+
| [pytest-mock](https://pypi.org/project/pytest-mock/) | `3.14.0` | Pytest mocker fixture |
74+
| [mkdocs-include-markdown-plugin](https://pypi.org/project/mkdocs-include-markdown-plugin/) | `7.1.2` | MkDocs Plugin include MkDn |
75+
| [mkdocs-macros-plugin](https://mkdocs-macros-plugin.readthedocs.io/) | `1.3.7` | MkDocs Plugin for macros |
76+
| [mkdocs-material](https://squidfunk.github.io/mkdocs-material/) | `9.5.49` | Documentation |
77+
| [mkdocstrings](https://mkdocstrings.github.io/) | `0.27.0` | Automatic documentation from code |
78+
| [ruff](https://github.com/astral-sh/ruff) | `0.7.3` | Fast linter and formatter |
79+
| [uv](https://github.com/astral-sh/uv) | `0.5.1` | Python package management |
8280

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

@@ -89,11 +87,12 @@ $ pip freeze | grep pyperclip
8987

9088
If your versions are lower than the prerequisite versions, you should update.
9189

92-
If you do not already have Python installed on your machine, we recommend using [uv](https://github.com/astral-sh/uv)
90+
If you do not already have Python installed on your machine, we recommend using [uv](https://github.com/astral-sh/uv)
9391
for all of your Python needs because it is extremely fast, meets all Python installation and packaging needs, and works
94-
on all platforms (Windows, Mac, and Linux). You can install `uv` using instructions at the link above.
92+
on all platforms (Windows, Mac, and Linux). You can install `uv` using instructions at the link above.
9593

9694
You can then install multiple versions of Python using `uv` like so:
95+
9796
```sh
9897
uv python install 3.10 3.11 3.12 3.13
9998
```
@@ -147,31 +146,31 @@ Do this prior to every time you create a branch for a PR:
147146
1. Make sure you are on the `master` branch
148147

149148
> ```sh
150-
> $ git status
151-
> On branch master
152-
> Your branch is up-to-date with 'origin/master'.
153-
> ```
149+
> $ git status
150+
> On branch master
151+
> Your branch is up-to-date with 'origin/master'.
152+
> ```
154153
155154
> If your aren't on `master`, resolve outstanding files and commits and checkout the `master` branch
156155
157156
> ```sh
158-
> $ git checkout master
159-
> ```
157+
> $ git checkout master
158+
> ```
160159
161160
2. Do a pull with rebase against `upstream`
162161
163162
> ```sh
164-
> $ git pull --rebase upstream master
165-
> ```
163+
> $ git pull --rebase upstream master
164+
> ```
166165
167166
> This will pull down all of the changes to the official master branch, without making an additional commit in your
168167
> local repo.
169168
170169
3. (_Optional_) Force push your updated master branch to your GitHub fork
171170
172171
> ```sh
173-
> $ git push origin master --force
174-
> ```
172+
> $ git push origin master --force
173+
> ```
175174
176175
> This will overwrite the master branch of your fork.
177176
@@ -213,8 +212,8 @@ package from the source.
213212

214213
`cmd2` has support for using [uv](https://github.com/astral-sh/uv) for development.
215214

216-
`uv` is single tool to replace `pip`, `pip-tools`, `pipx`, `poetry`, `pyenv`, `twine`, `virtualenv`, and more. `cmd2`
217-
contains configuration for using `uv` in it's `pyproject.toml` file which makes it extremely easy to setup a `cmd2`
215+
`uv` is single tool to replace `pip`, `pip-tools`, `pipx`, `poetry`, `pyenv`, `twine`, `virtualenv`, and more. `cmd2`
216+
contains configuration for using `uv` in it's `pyproject.toml` file which makes it extremely easy to setup a `cmd2`
218217
development environment using `uv`.
219218

220219
To create a virtual environment and install everything needed for `cmd2` development using `uv`, do the following
@@ -238,6 +237,7 @@ uv run examples/basic.py
238237
```
239238

240239
Alternatively you can activate the virtual environment using the OS-specific command such as this on Linux or macOS:
240+
241241
```sh
242242
source .venv/bin/activate
243243
```
@@ -316,7 +316,7 @@ primarily related to continuous integration and release deployment.
316316
#### Changes to the documentation files
317317

318318
If you made changes to any file in the `/docs` directory, you need to build the
319-
Sphinx documentation and make sure your changes look good:
319+
MkDocs documentation and make sure your changes look good:
320320

321321
```sh
322322
$ uv inv docs
@@ -337,7 +337,7 @@ served (usually [http://localhost:8000](http://localhost:8000)).
337337
### Code Quality Checks
338338

339339
You should have some sort of [PEP 8](https://www.python.org/dev/peps/pep-0008/)-based linting running in your editor or
340-
IDE or at the command line before you commit code. `cmd2` uses [ruff](https://github.com/astral-sh/ruff) as part of
340+
IDE or at the command line before you commit code. `cmd2` uses [ruff](https://github.com/astral-sh/ruff) as part of
341341
its continuous integration (CI) process for both linting and auto-formatting.
342342

343343
> Please do not ignore any linting errors in code you write or modify, as they are meant to **help** you and to ensure a
@@ -440,7 +440,7 @@ nothing to commit, working directory clean
440440
any outstanding files/commits and checkout master `git checkout master`
441441

442442
2. Create a branch off of `master` with git: `git checkout -B
443-
branch/name-here` **Note:** Branch naming is important. Use a name like
443+
branch/name-here` **Note:** Branch naming is important. Use a name like
444444
`fix/short-fix-description` or `feature/short-feature-description`. Review
445445
the [Contribution Guidelines](#contribution-guidelines) for more detail.
446446

@@ -449,7 +449,7 @@ nothing to commit, working directory clean
449449
4. Check your `git status` to see unstaged files
450450

451451
5. Add your edited files: `git add path/to/filename.ext` You can also do: `git
452-
add .` to add all unstaged files. Take care, though, because you can
452+
add .` to add all unstaged files. Take care, though, because you can
453453
accidentally add files you don't want added. Review your `git status` first.
454454

455455
6. Commit your edits: `git commit -m "Brief description of commit"`. Do not add the issue number in the commit message.
@@ -482,17 +482,17 @@ how to do it.
482482
4. The title (also called the subject) of your PR should be descriptive of your
483483
changes and succinctly indicate what is being fixed
484484

485-
- **Do not add the issue number in the PR title or commit message**
485+
- **Do not add the issue number in the PR title or commit message**
486486

487-
- Examples: `Add test cases for Unicode support`; `Correct typo in overview documentation`
487+
- Examples: `Add test cases for Unicode support`; `Correct typo in overview documentation`
488488

489489
5. In the body of your PR include a more detailed summary of the changes you
490490
made and why
491491

492-
- If the PR is meant to fix an existing bug/issue, then, at the end of
493-
your PR's description, append the keyword `closes` and #xxxx (where xxxx
494-
is the issue number). Example: `closes #1337`. This tells GitHub to
495-
close the existing issue if the PR is merged.
492+
- If the PR is meant to fix an existing bug/issue, then, at the end of
493+
your PR's description, append the keyword `closes` and #xxxx (where xxxx
494+
is the issue number). Example: `closes #1337`. This tells GitHub to
495+
close the existing issue if the PR is merged.
496496

497497
6. Indicate what local testing you have done (e.g. what OS and version(s) of Python did you run the
498498
unit test suite with)
@@ -632,8 +632,8 @@ mostly automated. The manual steps are all git operations. Here's the checklist:
632632
1. Make sure all the unit tests pass with `invoke pytest` or `py.test`
633633
1. Make sure latest year in `LICENSE` matches current year
634634
1. Make sure `CHANGELOG.md` describes the version and has the correct release date
635-
1. Add a git tag representing the version number using ``invoke tag x.y.z``
636-
* Where x, y, and z are all small non-negative integers
635+
1. Add a git tag representing the version number using `invoke tag x.y.z`
636+
- Where x, y, and z are all small non-negative integers
637637
1. (Optional) Run `invoke pypi-test` to clean, build, and upload a new release to [Test PyPi](https://test.pypi.org)
638638
1. Run `invoke pypi` to clean, build, and upload a new release to [PyPi](https://pypi.org/)
639639

.github/workflows/doc.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
33
name: Doc
44

5-
on: [ push, pull_request, workflow_dispatch ]
5+
on: [push, pull_request, workflow_dispatch]
66

77
permissions:
88
contents: read
@@ -11,21 +11,21 @@ jobs:
1111
doc:
1212
strategy:
1313
matrix:
14-
os: [ ubuntu-latest ]
15-
python-version: [ "3.12" ]
14+
os: [ubuntu-latest]
15+
python-version: ["3.12"]
1616
fail-fast: false
1717
runs-on: ${{ matrix.os }}
1818
steps:
19-
- uses: actions/checkout@v4 # https://github.com/actions/checkout
19+
- uses: actions/checkout@v4 # https://github.com/actions/checkout
2020
with:
2121
# Only a single commit is fetched by default, for the ref/SHA that triggered the workflow.
2222
# Set fetch-depth: 0 to fetch all history for all branches and tags.
2323
fetch-depth: 0 # Needed for setuptools_scm to work correctly
2424
- name: Set up Python
25-
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
25+
uses: actions/setup-python@v5 # https://github.com/actions/setup-python
2626
with:
2727
python-version: ${{ matrix.python-version }}
2828
- name: Install python prerequisites
29-
run: pip install -U --user pip setuptools setuptools-scm sphinx sphinx-autobuild sphinx-rtd-theme . plugins/ext_test
30-
- name: Sphinx documentation build
31-
run: python -m sphinx -M html docs docs/_build -nvWT
29+
run: pip install -U --user pip setuptools setuptools-scm mkdocs-include-markdown-plugin mkdocs-macros-plugin mkdocs-material . plugins/ext_test
30+
- name: MkDocs documentation build
31+
run: mkdocs build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# Python development, test, and build
22
__pycache__
3+
target
34
build
45
dist
56
*.egg-info

.readthedocs.yaml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,18 @@
1-
# Read the Docs configuration file for Sphinx projects
2-
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
1+
# Read the Docs configuration file for MkDocs projects
2+
# See https://docs.readthedocs.io/en/stable/intro/mkdocs.html for details
33

44
# Required
55
version: 2
66

77
# Set the OS, Python version and other tools you might need
88
build:
9-
os: ubuntu-22.04
9+
os: ubuntu-24.04
1010
tools:
1111
python: "3.12"
1212

13-
# Build documentation in the "docs/" directory with Sphinx
14-
sphinx:
15-
configuration: docs/conf.py
16-
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
17-
# builder: "dirhtml"
18-
# Fail on all warnings to avoid broken references
19-
# fail_on_warning: true
13+
# Build documentation in the "docs/" directory with MkDocs
14+
mkdocs:
15+
configuration: mkdocs.yml
2016

2117
# Optionally build your docs in additional formats such as PDF and ePub
2218
# formats:

Pipfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ pytest-cov = "*"
2424
pytest-mock = "*"
2525
ruff = "*"
2626
setuptools-scm = "*"
27-
sphinx = "*"
28-
sphinx-autobuild = "*"
29-
sphinx-rtd-theme = "*"
27+
mkdocs-include-markdown-plugin = "*"
28+
mkdocs-macros-plugin = "*"
29+
mkdocs-material = "*"
3030
twine = ">=1.11"
3131

3232
[pipenv]

docs/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)