stencila/designa

CodeChunk: meta properties

Closed this issue · 2 comments

I recently implemented handling of Rmarkdown code chunk options fig.width and fig.height in Rasta: stencila/rasta@f721587

These are stored in a CodeChunk's meta property and Rasta will create the correctly sized and proportioned images:

image

However, when these are re-executed from a Designa Web Component, it appears that the meta property is lost and the figure gets rendered with default dimensions:

image

Can confirm that Encoda is encoding these meta attributes to HTML:

<stencila-code-chunk itemscope="" itemtype="http://schema.stenci.la/CodeChunk" data-fig.width="1000" data-fig.height="600" data-programminglanguage="r" class="sc-stencila-code-chunk-default-h sc-stencila-code-chunk-default-s hydrated isCodeVisible">

but that they are not parsed out and put into meta

@alex-ketch and I discussed and felt that:

  • data-programminglanguage="r" should be encoded as programminglanguage="r" and anything that has a data- attribute be lumped into the nodes' meta property

  • the dimensions of a code chunk's image outputs are important enough to be worthy of their own, schema defined, properties e.g. CodeChunk.outputDimensions and that there could be a panel in the Web Component to be able to set these.

We won't rush to fix this for now and will implement a workaround in Rasta in the short term ahead of the above proposal.

Closing this as stale.