Published
Edited
Aug 30, 2022
Also listed in…
Tips and Utilities
Insert cell
Insert cell
Insert cell
Insert cell
kdljs = import('https://cdn.skypack.dev/kdljs@0.1.4?min')
Insert cell
Insert cell
myout = {
const response = kdljs.parse(`// Nodes can be separated into multiple lines
title \
"Some title"


// Files must be utf8 encoded!
smile "😁"

// Instead of anonymous nodes, nodes and properties can be wrapped
// in "" for arbitrary node names.
"!@#$@$%Q#$%~@!40" "1.2.3" "!!!!!"=true


// kdl specifically allows properties and values to be
// interspersed with each other, much like CLI commands.
foo bar=true "baz" quux=false 1 2 3
`)

yield response

}
Insert cell
Insert cell
foo= {
const out = kdljs.format(myout.output)
yield out
}
Insert cell
{
const out = kdljs.parse(`bookmarks 12 15 188 1234 `)
yield out
}
Insert cell
Insert cell
{
const query = kdljs.query(myout.output, "top() title" )
yield query
}
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more