[Ann] BonitoBook update: Plugin System, Language Extensions & Simplified Styling

Hi everyone,

I just released a major update to BonitoBook with a powerful new plugin system and significantly faster loading times.

Plugin System

The biggest feature is a flexible plugin system that lets you completely customize how notebooks are rendered. Create custom book types by defining a module with create_book() and jsrender():

struct MyBook <: BonitoBook.AbstractBook
book::BonitoBook.Book
end
create_book(book::BonitoBook.Book; kwargs...) = MyBook(book)
# Custom rendering logic, which allows easy re-using of existing functionality
Bonito.jsrender(session::Session, my_book::MyBook) = ...

Check out the examples to see the plugins in action:

Slideshow

Create presentations from your notebooks

Draggable layouts

Interactive, repositionable cells

Scientific book format

Build your own notebook styles with table of content and customized table display etc.

Faster Loading

Moved PythonCall and WGLMakie to an extensions, significantly reducing dependencies and load times. Took the chance to make the language support very easy to extend and overload for any other language, check out the new howto section to learn more!

Other Improvements

  • Simplified styling with single generate_style() function
  • Inline slider values in @manipulate
  • Better mobile styling and tooltips
  • Flat folder structure with lazy file loading (as long as you dont customize styling it will be loaded from BonitoBook templates, making updates much easier)

Migration

For existing users: Delete .name-bbook/ folder and restart (backup custom files first if needed).

Full details in the new blog.

I’m excited to see what plugins the community creates!

44 Likes

Absolutely beautiful, I’m excited to see the load time reduction and possibility for a slideshow. For this year’s Juliacon I made “slides” in Pluto but with Makie, which worked in the end but was rather challenging (bridging the Pluto interactivity with Observables and not having everything crash).

I can only dream of the day when Julia will get a WASM backend which will let us send notebooks like these straight to students/customers/etc. I asked @Keno if WASM is still coming and he said that it should be technically feasible, although noone in the compiler team has time for that right now (presumably because all of the amazing ongoing trimming work).

2 Likes

Awesome!
The link in the blogpost to the plugin guide needs to be updated from https://bonitobook.org/howto/bonitobook-plugin to https://bonitobook.org/website/howto/bonitobook-plugin/ :slight_smile:

2 Likes