Replies: 2 comments
-
Thanks for the feedback! Some clarifications… First, in Notebooks 2.0, you can still use Observable JavaScript cells. You can choose Thanks for the feedback! Some clarifications… First, in Notebooks 2.0, you can still use Observable JavaScript cells. You can choose Observable JavaScript from the cell menu or the Edit menu in Observable Desktop, and in Notebook Kit, you use Second, in Notebooks 2.0, you can use the <!doctype html>
<notebook>
<script type="text/html" output="foo">
This is an <b>HTML</b> cell!
</script>
<script type="module">
foo.innerText
</script>
</notebook> This renders as: ![]() That said, Observable Desktop only implements the output UI for SQL cells, and not for other cell types. So, you’ll need to edit the notebook source file manually to assign an output for a given cell, but it should be preserved if you subsequently edit the notebook in Desktop. As for anchor links, Notebook Kit already uses markdown-it-heading-anchor to render links to heading elements in Markdown. So you can use normal Markdown headings to link to sections to a notebook. Or you can use HTML directly. (Since unlike Notebooks 1.0, Notebooks 2.0 are not rendered into an iframe but exist at the top-level.) Hope this helps! from the cell menu or the Edit menu in Observable Desktop, and in Notebook Kit, you use Second, in Notebooks 2.0, you can use the <!doctype html>
<notebook>
<script type="text/html" output="foo">
This is an <b>HTML</b> cell!
</script>
<script type="module">
foo.innerText
</script>
</notebook> This renders as: ![]() That said, Observable Desktop only implements the output UI for SQL cells, and not for other cell types. So, you’ll need to edit the notebook source file manually to assign an output for a given cell, but it should be preserved if you subsequently edit the notebook in Desktop. As for anchor links, Notebook Kit already uses markdown-it-heading-anchor to render links to heading elements in Markdown. So you can use normal Markdown headings to link to sections to a notebook. Or you can use HTML directly. (Since unlike Notebooks 1.0, Notebooks 2.0 are not rendered into an iframe but exist at the top-level.) Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
Thank you @mbostock for taking the time to answer this. What you say makes sense. Can I request that output UI for md and HTML cells be added to Observable Desktop? Would it be OK for me to go ahead and do this in Issues? Also, wouldn't it be kinda great if all symbol defs (if I'm using the right terms, and including any output's) in a notebook were automatically given anchors in any resultant static site after |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In Observable 1.x any cell could be given a name, and this name would immediately operate as a top level constant. This no longer holds for 2.0.
In 1.x the cell name also became the (id?/name?) attribute of its HTML rendering. This allowed an elegant way to:
Many of my notebooks are broken by this in Observable 2.0 so I am noting this issue as a bug. But I'd also love to see it carried it over and supported as a feature which recognizes the equal status of text-as-data, especially when using the actual text (as-data) of the notebooks that you are reading is so much in the spirit of the Literate Programming that Observable champions.
BTW, I love what you are doing with Observable Notebooks 2.0.
Beta Was this translation helpful? Give feedback.
All reactions