Skip to content

Add Zensical documentation option#738

Merged
henryiii merged 8 commits intoscientific-python:mainfrom
VeckoTheGecko:zensical
Feb 5, 2026
Merged

Add Zensical documentation option#738
henryiii merged 8 commits intoscientific-python:mainfrom
VeckoTheGecko:zensical

Conversation

@VeckoTheGecko
Copy link
Contributor

@VeckoTheGecko VeckoTheGecko commented Feb 1, 2026

Fixes #737 1

PR done with reference to:

Since Zensical is in active development, the example docs (both config and pages) from zensical new . is likely to change quite a bit. I'm not sure if we should trim down zensical.toml, or just manually periodically update it based on zensical new ..

Testing

Manually by creating a quick example repo at https://github.com/VeckoTheGecko/zensical_cookie_test (see README-ROOT.md )

The RTD deployment for this example is at https://zensical-cookie-test.readthedocs.io/en/latest/

Not sure how to go about automated testing (or further integration into nox testing we have here) - not sure if its needed, from what I can tell the docs building, integration into RTD, etc are left to be manually tested

AI disclaimer

No AI used.


📚 Documentation preview 📚: https://scientific-python-cookie--738.org.readthedocs.build/

Footnotes

  1. I know this hasn't been discussed yet - feel free to reject this PR if this isn't something you're willing to maintain at this point. I thought a PR would be helpful to see the maintainer burden

With reference to:
- ReadTheDocs Zensical setup (adjusting to mesh with current cookie
  items) https://docs.readthedocs.com/platform/stable/intro/zensical.html#deploying-zensical-on-read-the-docs
- Using files generated by `zensical new .`
- Using help docs included in `zensical`
- Use cookiecutter.project_short_description
- Remove bullet on deploying docs
Copy link
Contributor Author

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

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

Do we need to make any updates to https://learn.scientific-python.org/development/guides/docs/#writing-documentation ? I think we're fine right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

docs/index.md, docs/markdown.md and zensical.toml are all provided by zensical new .

session.install("{% if cookiecutter.backend != "mesonpy" %}-e{% endif %}.", *doc_deps)

if session.interactive:
session.run("zensical", "serve", *session.posargs)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

serve doesn't have a clean option

]
{%- elif cookiecutter.docs == "zensical" %}
docs = [
"zensical>=0.0.20",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wanted to avoid a hard pin, but this may cause problems if zensical.toml changes

@VeckoTheGecko
Copy link
Contributor Author

VeckoTheGecko commented Feb 1, 2026

Hmmm, there's a bit of a conflict between the markdown flavouring in the Zensical SSG (+material mkdocs) and the prettier pre-commit hook https://github.com/VeckoTheGecko/zensical_cookie_test/actions/runs/21571031386/job/62150095699#step:5:339

-!!! warning "Needs configuration"
-    Note that MathJax is included via a `script` tag on this page and is not
-    configured in the generated default configuration to avoid including it
-    in a pages that do not need it. See the documentation for details on how
-    to configure it on all your pages if they are more Maths-heavy than these
-    simple starter pages.
+!!! warning "Needs configuration" Note that MathJax is included via a `script`
+tag on this page and is not configured in the generated default configuration to
+avoid including it in a pages that do not need it. See the documentation for
+details on how to configure it on all your pages if they are more Maths-heavy
+than these simple starter pages.

Interestingly since we use Material for Mkdocs for the mkdocs option, I think this is an error that also effects the mkdocs option

@squidfunk what's the best way to autoformat your flavour of markdown? (e.g., a specific prettier config?)

EDIT: Grammar :)

@squidfunk
Copy link

There are some formatters that support a subset of Python Markdown, but I currently use none, so I can't recommend one. Once we move to CommonMark, any popular Markdown formatter should work.

Also, I would kindly ask you to ask for such things on our Discord. As you can probably imagine, we're currently getting hammered with support requests, which eats into our time pushing Zensical out of alpha, so I'd appreciate it, if you would ask the community for help ☺️

@VeckoTheGecko
Copy link
Contributor Author

Of course! Didnt think about that. Ill join the discord :)

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
Copy link
Collaborator

henryiii commented Feb 4, 2026

I'd prefer lightweight config vs. template output, but that's okay for now, and maybe we could even add a nox job to regenerate the template output.

@VeckoTheGecko
Copy link
Contributor Author

VeckoTheGecko commented Feb 4, 2026

I'd prefer lightweight config vs. template output

Agreed, though thought to err on the side of template output for traceability since this is still in alpha.

I'll try fix the linting problems. I'll remove some of the markdown in the example page since its non-standard markdown and its conflicting with prettier

(I'd rather the user - or another PR - deals with the fact of #738 (comment) )

@henryiii henryiii merged commit ab443cc into scientific-python:main Feb 5, 2026
32 checks passed
@henryiii
Copy link
Collaborator

henryiii commented Feb 5, 2026

Thanks! I might see if I can add a regenerate option in nox later.

@VeckoTheGecko VeckoTheGecko deleted the zensical branch February 5, 2026 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Zensical as alternative to mkdocs

3 participants