After along slumber, Nimib is back with another update. For the average user who only use the builtin blocks (NbText, nbCode, nbImage etc) this doesn't bring any changes to your documents (fingers crossed!). But behind the scenes we have rebuilt Nimib's blocks and rendering from the ground up.
I will be hosting a talk about this update on NimConf 2026 for those that are interested.
The highlights are:
newNbBlock(NbImage):
url: string
caption: string
alt: string
toHtml:
&"""
<figure>
<img src="{blk.url}" alt="{blk.alt}">
<figcaption>{blk.caption}</figcaption>
</figure>
"""
template image*(url: string, caption = "", alt = "") =
let blk = newNbImage()
blk.url = nb.doc.relToRoot(url)
blk.caption = caption
blk.alt = if alt.len == 0: caption else: alt
nb.add blk
This does mean that if you have defined a custom block with custom rendering, it will have to be rewritten using the new structures. For more details and a migration example see the release notes: https://github.com/pietroppeter/nimib/releases/tag/v0.4.0
Congrats on the new release!
I'm a huge fan of Nimib and NimiBook, it's great that the project is alive and evolving.
If (when?) NimiBook adds site-wide search and a couple of convenience features, I'll be able to replace mdBook with it.