stencila/designa

CodeExpression: add a programmingLanguage property

Closed this issue · 3 comments

Curently CodeExpression component does not have a programmingLanguage property which it inherits from Code as does CodeChunk.

This is still an issue and means that CodeExpressions can not be executed because when they are sent to Executa, they lack programmingLanguage property that allows them to be delegated to the correct language interpreter (currently they are returned unexecuted):

image

Note that currently, Encoda is encoding code expressions in HTML with the programming-language="r" attribute, which is inconsistent with data-programminglanguage="r" that is used for code chunks:

<stencila-code-expression programming-language="r" itemscope=""
  itemtype="http://schema.stenci.la/CodeExpression"><code class="r"
  slot="text">length(subset(data2, Lot==1 &amp; Time==0)$value)</code><output
  slot="output"><span data-itemtype="http://schema.org/Number">3</span></output>
</stencila-code-expression>

Thanks for this @alex-ketch, what should the HTML attribute be for both CodeChunks and CodeExpressions: programming-language or data-programminglanguage?

Right now there's a discrepancy, but ideally it should be programming-language for both.
Will log an issue in Encoda to make the change.