@celine/celine

A microlibrary for building reactive HTML notebooks
celine ~~> cell inline
Author Max Bo Updated
GitHub MaxwellBo/celine License MIT
JSR jsr.io/@celine/celine + /docs Version ?

@celine/celine is the library I promised everyone I'd release in Reactive HTML notebooks (2024).

It wraps a subset of the Observable Notebook runtime to provide a minimal (and opinionated) API for notebook construction.

## Installation

Add the following style and script elements to your HTML file. Customize to your liking.



All of the following scripts are marked contenteditable and reevaluate on blur.

## cell

The cell constructor declares a reactive cell that can depend on other cells.

The definition can return values of type T, Promise<T>, Iterator<T>, or AsyncIterator<T>.

Ensure the script id is the NAME parameterized to the cell constructor.

## viewof

The viewof constructor is a special constructor designed to work with with Observable Inputs.

It declares 2 reactive cells: the NAME cell and the viewof NAME cell - one for the value, and one for the DOM element itself.

Ensure the script id is of the form viewof NAME to display the input.

For further information on how to create custom inputs, see the Syncronized Inputs guide.

## mutable

mutable is a cell constructor that both declares a cell and returns a reference that can be mutated. Mutations propogate to cells that depend upon it.

## TeX, Markdown, Graphviz

There are many useful utilities inside of the Observable standard library.


## Observable Plot


  _..._                                                                
  .-'_..._''.                    .---.                                    
.' .'      '.\     __.....__     |   |.--.   _..._         __.....__      
/ .'            .-''         '.   |   ||__| .'     '.   .-''         '.    
. '             /     .-''"'-.  `. |   |.--..   .-.   . /     .-''"'-.  `.  
| |            /     /________\   \|   ||  ||  '   '  |/     /________\   \ 
| |            |                  ||   ||  ||  |   |  ||                  | 
. '            \    .-------------'|   ||  ||  |   |  |\    .-------------' 
\ '.          .\    '-.____...---.|   ||  ||  |   |  | \    '-.____...---. 
'. `._____.-'/ `.             .' |   ||__||  |   |  |  `.             .'  
  `-.______ /    `''-...... -'   '---'    |  |   |  |    `''-...... -'    
           `                              |  |   |  |                     
                                          '--'   '--'