drasil-data-formats-0.0.1: A framework for code and document generation for scientific software
Safe HaskellNone
LanguageGHC2024

Drasil.Data.Formats.Jupyter

Synopsis

Documentation

data Cell Source #

A Markdown cell or an unexecuted code cell.

Constructors

MarkdownCell 

Fields

  • Metadata

    Cell-level metadata. TODO: Use the CommonMark AST from #5406 for Markdown cell content.

  • Text

    Rendered Markdown source.

CodeCell 

Fields

Instances

Instances details
Show Cell Source # 
Instance details

Defined in Drasil.Data.Formats.Jupyter.Core

Methods

showsPrec :: Int -> Cell -> ShowS #

show :: Cell -> String #

showList :: [Cell] -> ShowS #

Eq Cell Source # 
Instance details

Defined in Drasil.Data.Formats.Jupyter.Core

Methods

(==) :: Cell -> Cell -> Bool #

(/=) :: Cell -> Cell -> Bool #

data Notebook Source #

A new notebook containing ordered cells and document metadata.

Constructors

Notebook 

Fields

Instances

Instances details
Show Notebook Source # 
Instance details

Defined in Drasil.Data.Formats.Jupyter.Core

Eq Notebook Source # 
Instance details

Defined in Drasil.Data.Formats.Jupyter.Core

type Metadata = [(Text, JSON)] Source #

Cell metadata stored as JSON object entries.

data KernelSpec Source #

The kernel used to execute a notebook.

Instances

Instances details
Show KernelSpec Source # 
Instance details

Defined in Drasil.Data.Formats.Jupyter.Core

Eq KernelSpec Source # 
Instance details

Defined in Drasil.Data.Formats.Jupyter.Core

defaultPython39Metadata :: NotebookMetadata Source #

Python 3.9.1 metadata used by the current notebook generators.

data CellSourceRenderStyle Source #

JSON representation of cell source.

Constructors

ListOfLines

One string per line, with a trailing LF.

SingleString

One string containing the whole cell.

data NotebookRenderOptions Source #

Notebook format options, separate from JSON layout options. Version numbers label the output; they do not convert the notebook structure.

defaultNotebookRenderOptions :: NotebookRenderOptions Source #

Use notebook format 4.4 and a list of lines per cell by default.

notebookToJSON :: NotebookRenderOptions -> Notebook -> JSON Source #

Encode a new notebook using the selected version and source representation.

renderNotebook :: NotebookRenderOptions -> JSONRenderOptions -> Notebook -> Doc ann Source #

Render a notebook with the shared JSON renderer.