notebook/format
src/notebook/format.tur
defn
node-tag
(node-tag [node :int])
return 0 for prose nodes and 1 for cell nodes.
defn
node-prose
(node-prose [node :int])
extract the md-node handle from a prose node.
defn
node-cell
(node-cell [node :int])
extract the cell handle from a cell node.
defn
parse-string
(parse-string [s :cstr])
parse notebook markdown into prose and cell nodes.
defn
parse-file
(parse-file [path :cstr])
read a notebook file from disk and parse it.
defn
nodes->str
(nodes->str [nodes :int])
serialize notebook nodes back to normalized markdown.
defn
nodes-update-cell
(nodes-update-cell [nodes :int cell-id-want :cstr new-source :cstr])
replace the source of a named cell in an immutable node list.
Internal definitions
__fmt-nil-value__fmt-list-nil?__fmt-cons__fmt-head__fmt-tail__ok__err__fmt-cstr-eq?__fmt-str-concat__fmt-cstr-as-int__fmt-int-as-cstr__fmt-slurp__fmt-cstr-free__fmt-cstr-null?__fmt-node-make__node-prose-make__node-cell-make__lang-from-info__lang-label__span-start__span-end__inject-no-check-attr__block->node__blocks->nodes__render-attr-list__render-attrs__render-node__nodes->str-int__copy-cell-with-source__replace-node-if-match__node-list-has-cell?__replace-node-list