Skip to main content

Code

Base type for code nodes e.g. CodeBlock, CodeExpression.

!array('The most important, and only required, property of a ')Code!array(' node is ')text!array('. This property is a ')string!array(' of the source code. There are no restrictions on the length or content of ')text!array(' and it is possible for it to be syntactically invalid for the specified ')programmingLanguage!array('.')

Properties#

Name@idTypeDescriptionInherited from
textschema:textstringThe text of the code.Code
formatschema:encodingFormatstringMedia type, typically expressed using a MIME format, of the code. See note 1.Code
idschema:idstringThe identifier for this item.Entity
metastencila:metaobjectMetadata associated with this item.Entity
programmingLanguageschema:programmingLanguagestringThe programming language of the code.Code

Notes#

  1. format : !array('This property allows the differentiation of formats using the same programming language or variants of a programming language. An example is using ')programmingLanguage!array(' "json" and ')encodingFormat!array(' "application/ld+json" for JSON-LD code examples.')

Related#

Available as#

Source#

This documentation was generated from Code.schema.yaml.