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 : String = "image", image_dest : String = "images") #

[View source]

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) }

[View source]
def content : JupyterSource #

[View source]
def export_images #

[View source]
def has_images? : Bool #

Return whether this notebook as images or not.


[View source]
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
}

[View source]
def metadata : JupyterMetadata #

Get the notebook's metadata as a JupyterMetadata


[View source]
def to_markdown : String #

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


[View source]