This is a really cool idea! I did a little bit of noodling on the API and came up with this: https://observablehq.com/d/d0bb058f650143a9. It preserves the handy `importCell` function but also allows you to, for example, import multiple things from one notebook while using injections.
Fancy! Thanks for sharing. We’re reflecting on how we can make imports more powerful and easier to use and it’s great to see more perspectives. Please let us know if you have more thoughts or suggestions on this topic!
This is ace, thanks! I've just been toying with it in a bid to make the D3 gallery data-driven (@bayre/gallery-ft-data). My notebook gives the API a bit of a beating, and the data comparison is quite rudimentary, but I think there is a version of it that could be useful. I'm going to put something similar together for our team to help unlock the templates we've built.
Thanks for this! It makes each notebook so much easier to reuse as a template, one feature I wanted to have is the ability to import a cell into a specific dom node in another cell (in current notebook), to create a composite cell with multiple imported charts, titles, or other KPIs without having to write all the code in the same cell, or using things from multiple notebooks to create a dashboard of sorts. I got this to work using Observable Inspector here: https://observablehq.com/@a10k/importcell-into-existing-dom-node can you please review and suggest if there is a better way?