115 Commits

Author SHA1 Message Date
Martin Donath 645bbe881a fix: clear site directory contents instead of removing it (#621)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-05-03 16:46:58 +02:00
squidfunk 814d2e9edf fix: link validation yields false positives on Windows (#616)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-05-03 12:39:09 +02:00
Martin Donath b229bac9ad fix: zensical serve returns 404 after suspend (#574)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
Co-authored-by: takeshiD <goriponikeike55@gmail.com>
2026-05-01 20:08:37 +02:00
Martin Donath 0291ad5360 chore: release v0.0.39
## Summary

This version fixes several bugs related to link validation and lightbox configuration.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-05-01 18:24:15 +02:00
Martin Donath 89d99bafaf Merge pull request #597 from zensical/fix/validation-text-fragment
fix: anchor not extracted from combined anchor-text-fragment
2026-05-01 18:02:52 +02:00
squidfunk 699d3be0f6 fix: add Python backtrace on Markdown rendering error
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-05-01 13:09:24 +02:00
squidfunk acc2620a57 fix: validation doesn't correctly map percent-encoded links (#598)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-30 17:33:54 +02:00
squidfunk 94f0d29756 fix: anchor not extracted from combined anchor-text-fragment
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-30 15:31:21 +02:00
Martin Donath 0e7f1d8cf8 chore: release v0.0.38
## Summary

This version adds [link and footnote validation] and [strict mode] – two of the most frequently requested features. Zensical now checks all internal references at build time and reports issues with precise source locations, so broken links don't make it into your published documentation. Unlike MkDocs, which only validates final rendered links, Zensical also checks for unresolved references,  as well as unused and shadowed definitions – covering the full lifecycle of a reference from definition to use.

[link and footnote validation]: https://zensical.org/docs/setup/validation/
[strict mode]: https://zensical.org/docs/setup/validation/#strict-mode

### Validation

Zensical scans every Markdown file in your project and resolves all internal references against each other: inline links, reference-style links, footnotes, link definitions, and anchor targets. Every check is individually configurable and enabled by default.

``` console
$ zensical build
...
Warning: page does not exist
   ╭─[ index.md:3:14 ]
   │
 3 │ [this page]: non-existent.md
   │              ───────┬───────
   │                     ╰───────── page does not exist
───╯
```

The following checks for links and footnotes are now available:

- [`unresolved_references`](https://zensical.org/docs/setup/validation/#unresolved_references)
- [`unresolved_footnotes`](https://zensical.org/docs/setup/validation/#unresolved_footnotes)
- [`unused_definitions`](https://zensical.org/docs/setup/validation/#unused_definitions)
- [`unused_footnotes`](https://zensical.org/docs/setup/validation/#unused_footnotes)
- [`shadowed_definitions`](https://zensical.org/docs/setup/validation/#shadowed_definitions)
- [`shadowed_footnotes`](https://zensical.org/docs/setup/validation/#shadowed_footnotes)
- [`invalid_links`](https://zensical.org/docs/setup/validation/#invalid_links)
- [`invalid_link_anchors`](https://zensical.org/docs/setup/validation/#invalid_link_anchors)

### Strict mode

The new `--strict` command line flag causes the build to fail when any enabled validation check triggers, turning warnings into errors. This is useful for CI pipelines where you want to enforce link integrity and prevent broken documentation from being published:

``` console
$ zensical build --strict
...
Warning: unresolved link reference
   ╭─[ index.md:1:35 ]
   │
 1 │ This is an [unresolved reference][id].
   │                                   ─┬
   │                                    ╰── unresolved link reference
───╯
1 issue found
Aborted because --strict flag is set
```

## Upgrading

No changes to your configuration are required – all checks are enabled by default. It's quite likely that you'll run into at least some warnings – [as we did] – when upgrading, since before, it was easy to miss unused link definitions or unresolved references. If you want to [disable validation entirely](https://zensical.org/docs/setup/validation/), you can use:

``` toml
[project]
validation = false
```

As always, if you run into any problems, please [open an issue](https://github.com/zensical/zensical/issues).

[as we did]: https://github.com/zensical/docs/commit/facabcce36977468ef6465f2ac19ff68b692ada2
[disable validation entirely]: https://zensical.org/docs/setup/validation/#configuration-zensicaltoml_1

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-30 13:56:34 +02:00
Martin Donath 201c615cd0 feature: add link and footnote validation and --strict mode (#175)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-30 13:17:23 +02:00
Timothée Mazzucotelli b3c1d91ed8 refactor: use our markdown subclasses
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-28 12:34:15 +00:00
Martin Donath ce8cbf817c refactor: simplify function definitions after zrx upgrade
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-27 16:56:48 +02:00
Martin Donath 55c9d26e91 chore: release v0.0.37
## Summary

This version adds support for installable themes. You can now bundle your theme overrides and package them into a custom theme which can be installed via `pip`.

As of now, we closely mirror the process used by MkDocs, where themes just need to register themselves in the `mkdocs.themes` entrypoint, to allow users that already have derivations of Material for MkDocs to run them on Zensical. In the coming months, with the advent of the [component system], we'll make this process much more flexible and foster reuse at the component level. For now, this is a first step to allow sharing of theme overrides and default configurations inside organizations with dozens or even thousands of projects.

> [!TIP]
>
> If your organization has been a happy user of Material for MkDocs and is considering switching to Zensical, please support our work through [Zensical Spark]. Your financial contribution helps us achieve full compatibility with MkDocs much faster, gives you access to hands-on support by the core team, and allows you to shape Zensical together with us.

[component system]: https://zensical.org/about/roadmap/#component-system
[Zensical Spark]: https://zensical.org/spark/

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-27 09:54:04 +02:00
Timothée Mazzucotelli 76945357dc feature: installable theme extensions (#511)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
Co-authored-by: squidfunk <martin.donath@squidfunk.com>
2026-04-24 13:37:59 +02:00
Martin Donath 5081de243f chore: release v0.0.36 (#576)
This version adds the missing update of the user interface that should've been included with 0.0.35.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-23 17:29:36 +02:00
Martin Donath ca9743add9 chore: release v0.0.35
## Summary

This version adds native support for [GLightbox], a JavaScript lightbox library to add zoom and gallery features to images. Images can be automatically annotated with the new `glightbox` Markdown extension. Add the following to `zensical.toml`:

``` toml
[project.markdown_extensions.zensical.extensions.glightbox]
```

> [!NOTE]
>
> In order to integrate with configuration in `mkdocs.yml`, where [GLightbox] is implemented as a plugin, a compatibility shim is included, so no re-configuration is necessary if you're already using the plugin. Note that our extension is more efficient and faster than the plugin, as it does not re-parse the entire HTML of each page, but instead uses Python Markdown's native extension API.

### HTML in the table of contents

Additionally, __section titles in the table of contents will now render with HTML markup__, so you can use emojis and other inline features in section titles and have them render correctly in the table of contents. In Material for MkDocs, this functionality was implemented with the `typeset` plugin. Zensical now supports this natively.

### Relative links in raw HTML

Relative links in raw HTML are now correctly resolved. Initially, we carried over the link processing and resolution logic from MkDocs, which does not support relative links in raw HTML to this day. We implemented a Python Markdown postprocessor, to ensure that relative links in raw HTML are handled as well.

[GLightbox]: https://biati-digital.github.io/glightbox/

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-23 17:03:57 +02:00
Martin Donath 5519730eea feature: render section title with markup in table of contents
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-23 12:14:42 +02:00
Timothée Mazzucotelli 773fa76b54 fix: support uv's symlink mode (#557)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-22 11:24:15 +00:00
Martin Donath f85eaf42a2 chore: release v0.0.34
## Summary

This version ships support for usage of TOML v1.1.0 in `zensical.toml`, which allows new lines in inline tables. Thus, configuration files can now be made more readable, especially when they contain long lists of items. For example:

__Prior to this version__

``` toml
palette = [
  { scheme = "default", toggle = { icon = "lucide/sun", name = "Switch to dark mode" } },
  { scheme = "slate", toggle = { icon = "lucide/moon", name = "Switch to light mode" } },
]
```

__With this version__

``` toml
palette = [
  {
    scheme = "default",
    toggle = {
      icon = "lucide/sun",
      name = "Switch to dark mode"
    }
  },
  {
    scheme = "slate",
    toggle = {
      icon = "lucide/moon",
      name = "Switch to light mode"
    }
  },
]
```

Additionally, Markdown pages with snippets are now rebuilt when snippets are updated, and an issue with breadcrumbs was fixed when the top-level `index.md` was not at the root of `nav` defined explicitly.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-21 11:04:03 +02:00
Martin Donath eacb402ead chore: calling Markdown::render can lead to race condition in Python
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-18 17:18:47 +02:00
Martin Donath 50aa8a5eb8 refactor: update to zrx to v0.0.21
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-18 12:21:23 +02:00
Timothée Mazzucotelli adad1faeb2 fix: detect snippets block syntax (#526)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-16 19:46:20 +02:00
Martin Donath f5df5e805b chore: update GitHub Actions workflows
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-16 18:13:03 +02:00
squidfunk c6e63b2b88 chore: fix clippy warning
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-16 18:10:07 +02:00
Timothée Mazzucotelli 111e1ebf95 fix: use a regex to detect snippets (#526)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-15 19:41:39 +00:00
Timothée Mazzucotelli d24ba8ac37 fix: always rebuild pages containing snippets (#526)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-15 10:06:09 +00:00
Martin Donath 4b9ed877e3 fix: don't consider non-root index.md a homepage, like MkDocs (#476)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-15 11:33:23 +02:00
Martin Donath 5af6512054 chore: release v0.0.33
## Summary

This version updates our official [Docker image] to be based on Alpine Linux for better compatibility and ease of use. It also adds all recommended Markdown Extensions to the generated `zensical.toml` file when bootstrapping a project with `zensical new`, ensuring a smoother setup experience. Additionally, the [user interface] is updated to [v0.0.13], which includes two bug fixes for anchor links in the table of contents.

[Docker image]: https://hub.docker.com/r/zensical/zensical
[user interface]: https://github.com/zensical/ui
[v0.0.13]: https://github.com/zensical/ui/releases/tag/v0.0.13

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-14 13:00:12 +02:00
Martin Donath ce00f3863b chore: release v0.0.32
## Summary

This version fixes a bug where Markdown files used as snippets were included into auto-generated navigation, and a bug with prefix stripping when the site URL contains a path component. Additionally, the Pygments dependency was updated to mitigate a vulnerability.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-07 13:33:21 +02:00
Timothée Mazzucotelli ca5d2d5c23 fix: strip base URL prefix as URL segment, not string (#499)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-07 10:55:28 +00:00
Timothée Mazzucotelli 92b5622532 fix: only collect markdown pages in docs directory (#490)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-04-03 12:40:20 +00:00
Martin Donath 62ca63b6f7 chore: release v0.0.31
## Summary

This version updates the [user interface] to [v0.0.12], which includes the [removal of 19 brand icons] due to the update of Lucide to v1, and the addition of 166 new icons, most of them in SimpleIcons and FontAwesome. Additionally, there are bug fixes related to the latest changes of the table of contents in the modern theme and instant navigation on anchor links.

[user interface]: https://github.com/zensical/ui
[v0.0.12]: https://github.com/zensical/ui/releases/tag/v0.0.12
[removal of 19 brand icons]: https://lucide.dev/guide/version-1

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-04-01 13:21:43 +02:00
Martin Donath 76d87b9036 chore: release v0.0.30
## Summary

This version adds support for [mike], a tool for managing multiple versions of MkDocs projects on GitHub Pages. We created [a tailored fork of mike] for Zensical – all mike commands should work as expected. See the [mike documentation] for usage instructions.

Note that this is a temporary solution. Zensical will ship [native support for versioning] in the near future, which will remove the GitHub Pages constraint and offer more flexibility in how versions are deployed and served.

The [user interface] is updated to [v0.0.11], which adds a floating table of contents for mobile to the modern theme. The toggle sits at the bottom of the screen for easy thumb access, and the sidebar scrolls to accommodate arbitrarily long tables of contents. This release also includes several improvements: snappier sidebar animations, better tooltip readability, and improved inline code block sizing.

[mike]: https://github.com/jimporter/mike
[a tailored fork of mike]: https://github.com/squidfunk/mike
[native support for versioning]: https://zensical.org/about/roadmap/#versioning
[mike documentation]: https://github.com/jimporter/mike#readme
[user interface]: https://github.com/zensical/ui
[v0.0.11]: https://github.com/zensical/ui/releases/tag/v0.0.11

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-28 18:49:44 +01:00
Martin Donath b8f21fb1e7 chore: release v0.0.29
## Summary

This version fixes an issue with absolute paths in links, as well as changed files not being picked up by Zensical on Windows 11.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-24 14:29:43 +01:00
Timothée Mazzucotelli 6775b75545 fix: canonicalize watched paths (#451)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-03-23 22:14:40 +01:00
Martin Donath 990a020eb4 chore: release v0.0.28
## Summary

This version updates the [user interface] to [v0.0.10], which fixes a couple of bugs related to search and code annotation rendering. Additionally, it adds support for version selectors in the modern theme, paving the way for adding support for [mike] to manage multiple versions of documentation on GitHub Pages.

In addition, this release adds new configuration options for the file watcher to improve compatibility in certain environments.

### File watcher

You can now opt into using a **polling-based file watcher**, which is particularly useful when running Docker on Windows, where filesystem event limitations (e.g., inotify constraints) can cause issues.

To enable the polling watcher:

``` bash
export ZENSICAL_POLL_WATCHER=1
```

The polling interval is configurable and defaults to `500` milliseconds (aligned with MkDocs behavior):

``` bash
export ZENSICAL_POLL_INTERVAL=500
```

[user interface]: https://github.com/zensical/ui
[v0.0.10]: https://github.com/zensical/ui/releases/tag/v0.0.10
[mike]: https://github.com/jimporter/mike

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-19 15:19:58 +01:00
Martin Donath f0144250c0 fix: auto-reload not working for Docker on Windows (#340) (#446)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-15 13:50:50 +01:00
Martin Donath 83cd642724 chore: release v0.0.27
## Summary

This version fixes a reload loop for when auto-appended snippets are located inside of the `docs` directory, and auto-reload for pages with Chinese path segments.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-13 18:48:02 +01:00
Martin Donath 062a972cc3 fix: printed URLs of built pages shouldn't be percent-encoded
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-13 18:42:47 +01:00
Martin Donath e326ae3c84 fix: auto-reload not working for URLs with Chinese path segments (#436)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-13 18:36:40 +01:00
Timothée Mazzucotelli 9654132346 fix: skip queuing redundant watch paths (#434)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-03-13 12:08:36 +01:00
Martin Donath 824410c129 chore: release v0.0.26
# Summary

This version fixes a regression introduced in 0.0.25 where the wheels built for manylinux x86 would be based on Python 3.8 instead of Python 3.10, making Zensical unusable on those architectures. This is
related to a [recent bug] in our upstream dependency [maturin], which was introduced in version 1.12.5. Additionally, it fixes a deprecation warning on Python 3.14 when using the emoji extension.

[recent bug]: https://github.com/PyO3/maturin/issues/3059
[maturin]: https://github.com/PyO3/maturin

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-11 10:44:03 +01:00
Martin Donath 88caefa8be chore: release v0.0.25
## Summary

This version updates the [user interface] to [v0.0.9], which improves on accessibility and fixes some minor rendering issues. Additionally, it fixes some bugs related to configuration parsing and plugin handling in `zensical serve`, ensuring a smoother development experience.

[user interface]: https://github.com/zensical/ui
[v0.0.9]: https://github.com/zensical/ui/releases/tag/v0.0.9

### Highlights

- `zensical serve` now keeps running on configuration parsing errors
- Auto-appended `pymdownx.snippets` files are now watched for changes
- Search highlighting now works with keyboard navigation

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-10 20:24:42 +01:00
Martin Donath b5c8767d05 fix: config parse errors shouldn't terminate zensical serve (#403)
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-03-10 17:27:21 +01:00
Pratyush Sharma 6c911cafc9 fix: watch auto-appended pymdownx.snippets files for changes (#148)
Signed-off-by: Pratyush Sharma <56130065+pratyush618@users.noreply.github.com>
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
Co-authored-by: squidfunk <martin.donath@squidfunk.com>
2026-03-10 17:00:28 +01:00
Timothée Mazzucotelli bf930dd84b fix: hash plugins config to trigger page rebuilds (#387)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-02-26 14:12:17 +01:00
Martin Donath 0ca44a6abc chore: release v0.0.24
## Summary

This version updates the [user interface] to [v0.0.8], which fixes issues with instant previews for Chinese and other non-ASCII languages, and layout shifts when switching from short to long pages in the modern theme. Additionally, same-page links for when directory URLs are disabled where not resolved correctly, which is fixed as well.

[user interface]: https://github.com/zensical/ui
[v0.0.8]: https://github.com/zensical/ui/releases/tag/v0.0.8

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-02-26 10:35:47 +01:00
Timothée Mazzucotelli 4b1ac98550 fix: same page links '.' with directory URLs disabled (regression) (#389)
Signed-off-by: Timothée Mazzucotelli <dev@pawamoy.fr>
2026-02-23 11:40:38 +01:00
Martin Donath d9462afc01 chore: release v0.0.23
# Summary

This version fixes a regression introduced in 0.0.22, where builds would error with mkdocstrings being not found, although the plugin wasn't configured.

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-02-11 22:16:43 +01:00
Martin Donath 7b845d9212 chore: release v0.0.22
## Summary

This version adds support for the [autorefs] plugin, and further improves performance for large mkdocstrings projects. The [user interface] is updated to [v0.0.7], which fixes some isses with the mobile browsering experience.

[autorefs]: https://github.com/mkdocstrings/autorefs
[user interface]: https://github.com/zensical/ui
[v0.0.7]: https://github.com/zensical/ui/releases/tag/v0.0.7

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
2026-02-11 19:22:20 +01:00