class

Holst::JupyterFile

Inherits Reference < Object

Representation of a Jupyter notebook

Constructors

new(file_path : String, image_prefix : String = "image", image_dest : String = "images")
Source

Instance methods

cells

Returns all the cells in this notebook as an Array(JupyterCell). Example:

notebook.cells.size # => 28
notebook.cells.each { |cell| puts(cell) }
Source
content
Source
export_images
Source
has_images?

Return whether this notebook as images or not.

Source
images

Get all images contained in this notebook. Images are returned as an array of Bytes.

Example:

i = 1
notebook.images.each { |img|
  File.write("image-#{i}.png", img)
  i += 1
}
Source
metadata

Get the notebook's metadata as a JupyterMetadata

Source
to_markdown

Return a markdown rendering of this notebook. Code cells are rendered as code blocks. Images are rendered as a link.

Source