Skip to content
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
56 changes: 34 additions & 22 deletions docs/pages/guides/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,18 @@ and Mkdocs, and uses the modern MyST plugin to get Markdown support.
> collection of notebooks using Sphinx internally. Can also be used for docs,
> though, see [echopype](https://echopype.readthedocs.io).

{: .warning-title }

> The Future of MkDocs
>
> The creators of `mkdocs-material` and `mkdocstrings` have come together to
> create a new documentation package called
> [Zensical](https://zensical.org/about/). The framework is still in alpha
> development, but aims to simplify the documentation process, be blazing fast,
> and move away from the limitations of MkDocs. This also means MkDocs's future
> is uncertain, and mkdocs-material will be minimally maintained until
> late 2026.

## What to include

Ideally, software documentation should include:
Expand Down Expand Up @@ -83,6 +95,24 @@ and MkDocs diverge.

{% tabs %}{% tab sphinx Sphinx %}

### pyproject.toml additions

Setting a `docs` dependency group looks like this:

```toml
[dependency-groups]
docs = [
"furo",
"myst_parser >=0.13",
"sphinx >=4.0",
"sphinx-copybutton",
"sphinx-autodoc-typehints",
]
```

You should include the docs group via `--group=docs` when using uv or pip to
install, or install all groups, such as by running `uv sync --all-groups`.

There is a sphinx-quickstart tool, but it creates unnecessary files (make/bat,
we recommend a cross-platform noxfile instead), and uses rST instead of
Markdown. Instead, this is our recommended starting point for `conf.py`:
Expand Down Expand Up @@ -248,33 +278,12 @@ to mark where you want the docs portion to start.

You can add the standard indices and tables at the end.

### pyproject.toml additions

Setting a `docs` dependency group looks like this:

```toml
[dependency-groups]
docs = [
"furo",
"myst_parser >=0.13",
"sphinx >=4.0",
"sphinx-copybutton",
"sphinx-autodoc-typehints",
]
```

You should use `--group=docs` when using uv or pip to install.

{% endtab %} {% tab mkdocs MkDocs %}

While the cookie cutter creates a basic structure for your MkDocs (a top level
`mkdocs.yml` file and the `docs` directory), you can also follow the official
[Getting started](https://squidfunk.github.io/mkdocs-material/getting-started/)
guide instead. Note, however, instead of the `pip` install, it is better
practice install your documentation dependencies via `pyproject.toml` and then
when you run your `uv sync` to install dependencies, you can explicitly ask for
the `docs` group to be installed via `uv sync --group=docs` or
`uv sync --all-groups`.
guide instead.

If you selected the `mkdocs` option when using the template cookie-cutter
repository, you will already have this group. Otherwise, add to your
Expand All @@ -292,6 +301,9 @@ docs = [
]
```

You should include the docs group via `--group=docs` when using uv or pip to
install, or install all groups, such as by running `uv sync --all-groups`.

These dependencies include several common plugins---such as generating reference
API documentation from docstrings---to make life easier.

Expand Down
3 changes: 1 addition & 2 deletions docs/pages/tutorials/docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ generator via [mkdocs-material][].
For more details, examples to help you pick between Sphinx and MkDocs (and
instructions for the latter), see the [documentation guide][]. For this simple
introduction, we will use Sphinx as it is still more popular with scientific
libraries, even though MkDocs is simpler to set up and more popular in general
with Python documentation.
Comment on lines -45 to -46
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm glad this is scaled back, I don't like the original statement, I don't think it was ever more popular1 than Sphinx, which is what Python itself uses. ;)

Footnotes

  1. For some definition of popular. Stars maybe. But usage by projects, no. ↩

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was just assuming before that stars were a proportional proxy to number of projects using it (as mkdocs-material has >3x the number of stars as sphinx). But obviously there are probably (exactly) one billion older projects that just use Sphinx out of the box without ever needing to go and find it on github and press the star button. Also read over it and thought "That is way too strong an opinion to have and espouse!"

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stars are more of a measure of "ohh, that looks interesting, I'll save it for later" than actual usage. I've got lots of stars that are on projects I thought looked interesting, but I've never used. Compare pip and uv, and pip last I checked was still 75% or so of downloads from PyPI (though getting that high in so short of a time is nothing short of amazing on uv's part, still!) Also there are Python projects with more stars than Python itself; it's also often a "reward" for looking cool/new/exciting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are words I will repeat to myself about why even though my projects have few stars they might still have millions of users ;)

libraries.

Please refer to the MyST documentation for more information on the Markdown
syntax in general and MyST's flavor of Markdown in particular.
Expand Down