Import code from ObservableHQ project to a Framework project

Hi! I’m exploring Observable Framework and it’s really interesting!

There is one thing however that i don’t understand, and probably I’m missing something.

How can I export/import a project from the observablehq platform into a Framework project?

I tried by using “export/download code” but it seems to create a package useful to be self-hosted but not relaly compatible with Framework.

So, which is the best way for doing that? In my practice would be very useful since you can draft and collaborate on a project using observableHq and then refine it using Framework.

furthermore, is there a way to import cells from Other observable projects? (e.g. swatches from Color legend / D3 | Observable)?

1 Like

Ho @mamauri

Good question! There are 2 ways to support that workflow.

  1. There is a Framework convert command (not documented yet) that converts a public notebook to a .md file that you can use in Framework.
    yarn observable convert <url>

  2. You can also copy and paste the cells into a .md file (you can copy and paste multiple cells…) and do some minor editing.

In both cases, if you are using notebooks contributed by others, please ensure that it has an open-source license and include proper attribution.

For the d3 color legend question, it may just be easier to use Observable Plot :slight_smile:

Thanks @Cobus!

Love this hidden command :slight_smile: thank you for the heads up, I will pay attention to licenses when reusing code.

I’ll also look better int plot, since usually i write my own charts i got used to import legends in that way.

1 Like

One of the challenge, I noticed is the “import of cells from other notebook”. It does not work !!.