class Holst::JupyterFile
- Holst::JupyterFile
- Reference
- Object
Overview
Representation of a Jupyter notebook
Defined in:
holst.crConstructors
Instance Method Summary
-
#cells : Array(JupyterCell)
Returns all the cells in this notebook as an
Array(JupyterCell)
. - #content : JupyterSource
- #export_images
-
#has_images? : Bool
Return whether this notebook as images or not.
-
#images : Array(Bytes)
Get all images contained in this notebook.
-
#metadata : JupyterMetadata
Get the notebook's metadata as a
JupyterMetadata
-
#to_markdown : String
Return a markdown rendering of this notebook.
Constructor Detail
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 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 to_markdown : String
#
Return a markdown rendering of this notebook. Code cells are rendered as code blocks. Images are rendered as a link.