juba / robservable

Observable notebooks as R htmlwidgets
https://juba.github.io/robservable/
162 stars 11 forks source link

Automatically import <style> cells ? #28

Open juba opened 4 years ago

juba commented 4 years ago

When CSS styles are defined with a html`` cell, they don't seem to be taken into account when the notebook is imported into Observable.

I'll do a reprex soon.

juba commented 4 years ago

For example, here :

https://observablehq.com/@danburzo/color-vision-deficiency-simulation

For the plot to render we have to include both the chart cell and the <style> cell.

robservable(
  "https://observablehq.com/@danburzo/color-vision-deficiency-simulation",
  include = c(5, 6)
)

This is normal behavior but as <style> cells are generally not named, could there be a possibility to automatically detect and import them ?

juba commented 4 years ago

I'm not sure this would be possible, as the only way I can think of would be to get access to the cell code to check if it begins with html`