Replies: 2 comments 3 replies
-
may I try out your semi-working solution? |
Beta Was this translation helpful? Give feedback.
-
As far as blogging goes, I recommend using Notebook Kit to convert each notebook to a web page (HTML) rather than converting it to a JavaScript library; you’ll want to statically render as much content as possible to improve page load performance and SEO. Ricky Reusser (@rreusser) is now using Notebook Kit for his blog, and posted a write-up; the source is also on GitHub. But yes, I also see Notebook Kit supporting compiling notebooks to JavaScript libraries. Probably this is how we will implement importing from a 2.0 notebook. Though if you want to maximize compatibility, you should just put your JavaScript code in a vanilla JavaScript module; then you can import it into a 2.0 notebook or any other web application and use it as-is without needing the Observable Runtime. |
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.
-
On my blog, I have a react component that allows me to render Observable 1.0 notebooks, and intersperse them in
.mdx
.This relies on the ability to export an observable 1.0 notebook as code (in particular I can npm install the notebook into my gatsby
So for instance:
https://www.robinlinacre.com/computing_fellegi_sunter/
is derived from
https://observablehq.com/@robinl/computing-the-fellegi-sunter-model
via this mdx:
https://github.com/RobinL/robinl.github.io/blob/dev/src/mdx/computing_fellegi_sunter.mdx?plain=1
where within my mdx i can do:
I'd like to migrate everything over to
notebook-kit
and notebooks 2.0. I've been hacking around a bit and have a semi-working solution that usesnotebook-kit
to transpile the html to a.js
file in a similar way to 1.0, but I wondered if there were any plans to support this kind of thing more officially?This may take the form of a command that ingests a
.html
notebook (in the format produced by the editor with the<notebook>
tag, and outputs an installable javascript package, in the same way that can be done with 'export' in notebooks 1.0. Or there may be a better approach.Thanks so much!
Beta Was this translation helpful? Give feedback.
All reactions