class Holst::JupyterFile

Overview

Representation of a Jupyter notebook

Defined in:

holst.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(file_path : String, image_prefix = "image", image_dest = "images") #

Instance Method Detail

def cells : Array(JupyterCell) #

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

notebook.cells.size # => 28
notebook.cells.each { |cell| puts(cell) }

def content : JupyterSource #

def export_images #

def has_images? : Bool #

Return whether this notebook as images or not.


def images : Array(Bytes) #

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
}

def metadata : JupyterMetadata #

Get the notebook's metadata as a JupyterMetadata


def to_markdown : String #

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