UNPKG

@stencila/schema

Version:

Stencila schema and other specifications

78 lines (77 loc) 2.15 kB
{ "title": "CodeFragment", "@id": "stencila:CodeFragment", "extends": "Code", "role": "secondary", "status": "stable", "category": "code", "description": "Inline code.", "properties": { "type": { "@id": "schema:type", "description": "The name of the type.", "type": "string", "enum": [ "CodeFragment", "CodeExpression" ], "default": "CodeFragment", "from": "Entity" }, "id": { "@id": "schema:id", "description": "The identifier for this item.", "type": "string", "from": "Entity" }, "meta": { "@id": "stencila:meta", "description": "Metadata associated with this item.", "type": "object", "from": "Entity" }, "programmingLanguage": { "@id": "schema:programmingLanguage", "description": "The programming language of the code.", "type": "string", "from": "Code" }, "format": { "@id": "schema:encodingFormat", "aliases": [ "encoding", "encodingFormat" ], "description": "Media type, typically expressed using a MIME format, of the code.", "$comment": "This property allows the differentiation of formats using the same programming language\nor variants of a programming language. An example is using `programmingLanguage` \"json\" and\n`encodingFormat` \"application/ld+json\" for JSON-LD code examples.\n", "type": "string", "from": "Code" }, "text": { "@id": "schema:text", "description": "The text of the code.", "type": "string", "from": "Code" } }, "file": "CodeFragment.schema.yaml", "children": [ "CodeExpression" ], "descendants": [ "CodeExpression" ], "$schema": "http://json-schema.org/draft-07/schema#", "$id": "https://schema.stenci.la/v0/CodeFragment.schema.json", "source": "https://github.com/stencila/schema/blob/master/CodeFragment.schema.yaml", "type": "object", "additionalProperties": false, "required": [ "type", "text" ], "propertyAliases": { "encoding": "format", "encodingFormat": "format" } }