Documentation
¶
Overview ¶
Package format reads and writes notebooks.
A notebook is a Markdown document. Its fenced code blocks whose info string's first word is "go", "ruby" or "julia" are code cells, in Go, Ruby or Julia; everything between them is prose, kept byte for byte. GitHub and any Markdown viewer show a notebook as a document, diffs are diffs of text, and no output is ever stored in the file: results live in the kernel's value store and in exports.
# Spectrum ```go x := ndarray.Linspace(0, 1, 1024) ```
Fences follow CommonMark: three or more backticks or tildes, indented by at most three spaces, closed by a fence of the same character at least as long. A code block in another language is prose.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cell ¶
type Cell struct {
Kind Kind
// Source is the cell's text: the Markdown of a prose cell, the Go code of
// a code cell (without its fences, ending in a newline unless empty).
Source string
// Line is the 1-based line of the document where Source starts.
Line int
// Info is a code cell's info string after its language (its options),
// trimmed.
Info string
// Lang is a code cell's language, the first word of its info string:
// "go", "ruby" or "julia".
Lang string
// contains filtered or unexported fields
}
Cell is one cell of a notebook.
func NewCodeIn ¶ added in v0.3.0
NewCodeIn returns a code cell in the language lang ("go", "ruby", "julia") holding src.