Bengal 0.2.0

Rosettes highlight caching, Pounce ASGI dev server, native notebook rendering, Kida & Patitas 0.2.0

Key additions: Block-level code block caching via RosettesHighlightCache, Pounce ASGI backend for the dev server (SSE live reload, fragment-based partial updates), Kida/Patitas 0.2.0 integration with AST-based block recompilation and structured error handling, and native Jupyter notebook rendering with download and Colab links.


Highlights

Rosettes Highlight Caching

Code block highlighting is now cached across pages to avoid re-highlighting identical blocks:

  • HighlightCache: Cache keyed onrosettes.content_hash(code, language) with extended key for hl_lines/show_linenos
  • Batch flow: Uncached blocks are highlighted in batch, then merged with cached results
  • Dependency: Requiresrosettes>=0.2.0(content_hash, HighlightItem, unified highlight_many)

Dev Server: Pounce ASGI Backend

The development server now uses Pounce instead of ThreadingTCPServer:

  • ASGI app: Static serving and HTML injection in a single ASGI application
  • SSE live reload: Real-time updates when content changes
  • Fragment-based partial updates: Efficient partial page updates instead of full reloads
  • Request logging: Clear visibility into served requests
  • Dependency: Requiresbengal-pounce>=0.2.0

Kida & Patitas 0.2.0

Template and parser stack updated to 0.2.0:

  • Kida structured errors: Bengal consumes structured error attributes instead of string parsing
  • AST-based block recompilation: Kida fragment fast path and partial evaluation
  • Dependencies:kida-templates>=0.2.0, patitas>=0.2.0

Native Notebook Rendering

Jupyter notebooks (.ipynb) are now rendered natively as doc pages—no conversion tools or extra dependencies. Drop notebooks into any content directory and build.

  • Download link: The.ipynbfile is copied to output; a download button links readers to the source notebook
  • Colab link: Addrepo_url to [params] in bengal.tomlfor auto-generated "Open in Colab" buttons on every notebook page
  • Binder: Addbinder_urlin section cascade or notebook frontmatter for "Run in Binder"

Configuration (inbengal.toml or config/_default/params.yaml):

[params]
repo_url = "https://github.com/your-org/your-repo"
colab_branch = "main"        # optional, default: main
colab_path_prefix = "site"   # when site lives in repo subdirectory

Override per-page with colab_url or download_urlin frontmatter. See Notebook Setup Guide for details.


Breaking Changes

None. This is a fully backward-compatible release.


Dependency Updates

Package Version Change
rosettes ≥0.2.0 content_hash, HighlightItem, unified highlight_many
kida-templates ≥0.2.0 Structured errors, AST block recompilation
patitas ≥0.2.0 Parser improvements
bengal-pounce ≥0.2.0 ASGI server for dev server

Upgrading

uv pip install --upgrade bengal
# or
pip install --upgrade bengal
# or use the self-update command
bengal upgrade