UNPKG

2.04 kBJSONView Raw
1{
2 "title": "CodeFragment",
3 "@id": "stencila:CodeFragment",
4 "extends": "Code",
5 "role": "secondary",
6 "status": "stable",
7 "category": "code",
8 "description": "Inline code.",
9 "properties": {
10 "type": {
11 "@id": "schema:type",
12 "description": "The name of the type.",
13 "type": "string",
14 "enum": [
15 "CodeFragment"
16 ],
17 "default": "CodeFragment",
18 "from": "Entity"
19 },
20 "id": {
21 "@id": "schema:id",
22 "description": "The identifier for this item.",
23 "type": "string",
24 "from": "Entity"
25 },
26 "meta": {
27 "@id": "stencila:meta",
28 "description": "Metadata associated with this item.",
29 "type": "object",
30 "from": "Entity"
31 },
32 "text": {
33 "@id": "schema:text",
34 "description": "The text of the code.",
35 "type": "string",
36 "from": "Code"
37 },
38 "programmingLanguage": {
39 "@id": "schema:programmingLanguage",
40 "description": "The programming language of the code.",
41 "type": "string",
42 "from": "Code"
43 },
44 "mediaType": {
45 "@id": "schema:encodingFormat",
46 "aliases": [
47 "encodingFormat"
48 ],
49 "description": "Media type, typically expressed using a MIME format, of the code.",
50 "$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",
51 "type": "string",
52 "from": "Code"
53 }
54 },
55 "file": "CodeFragment.schema.yaml",
56 "children": [],
57 "descendants": [],
58 "$schema": "http://json-schema.org/draft-07/schema#",
59 "$id": "https://schema.stenci.la/v1/CodeFragment.schema.json",
60 "source": "https://github.com/stencila/schema/blob/master/schema/CodeFragment.schema.yaml",
61 "type": "object",
62 "additionalProperties": false,
63 "required": [
64 "type",
65 "text"
66 ],
67 "propertyAliases": {
68 "encodingFormat": "mediaType"
69 }
70}