Public
Edited
Apr 6, 2023
2 stars
Insert cell
Insert cell
Insert cell
Insert cell
{
if (markdown) {
return html`<h2>Markdown for you to copy</h2>
<textarea style="width: 60%; height: 10em">${markdown.replace(
/<\/textarea>/gi,
"&lt;textarea&gt;"
)}</textarea>
`;
} else {
return html``;
}
}
Insert cell
Insert cell
Insert cell
jqScript = ` "# " + .title,
"*" + (.create_time | strftime("%Y-%m-%d %H:%M:%S")) + "*",
"\n",
first(.mapping[] | select(.message.author.role == "system")) as $firstSystem
| .mapping[]
| select(.message.author.role != null and .message.content.parts != null)
| select(. != $firstSystem)
| "**" + .message.author.role + "**: " + .message.content.parts[] + "

---"`
Insert cell
jq = require("jq-web")
Insert cell
output = {
try {
return jq.json(JSON.parse(input), jqScript);
} catch (e) {
return [];
}
}
Insert cell
markdown = output.join("\n")
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