@podlite/schema 0.0.74 → 0.0.76

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/CHANGELOG.podlite +48 -0
  2. package/esm/ast-helpers.d.ts +2 -1
  3. package/esm/ast-helpers.js +31 -2
  4. package/esm/ast-helpers.js.map +1 -1
  5. package/esm/codes/place.d.ts +13 -0
  6. package/esm/codes/place.js +105 -0
  7. package/esm/codes/place.js.map +1 -0
  8. package/esm/codes/read.d.ts +21 -0
  9. package/esm/codes/read.js +365 -0
  10. package/esm/codes/read.js.map +1 -0
  11. package/esm/codes/scan.d.ts +41 -0
  12. package/esm/codes/scan.js +332 -0
  13. package/esm/codes/scan.js.map +1 -0
  14. package/esm/exportHtml.js +44 -13
  15. package/esm/exportHtml.js.map +1 -1
  16. package/esm/exportMarkdown.js +32 -9
  17. package/esm/exportMarkdown.js.map +1 -1
  18. package/esm/guard.d.ts +9 -0
  19. package/esm/guard.js +100 -0
  20. package/esm/guard.js.map +1 -1
  21. package/esm/helpers/blockName.d.ts +1 -0
  22. package/esm/helpers/blockName.js +28 -2
  23. package/esm/helpers/blockName.js.map +1 -1
  24. package/esm/helpers/configPropagation.js +3 -1
  25. package/esm/helpers/configPropagation.js.map +1 -1
  26. package/esm/helpers/handlers.d.ts +3 -0
  27. package/esm/helpers/handlers.js +23 -0
  28. package/esm/helpers/handlers.js.map +1 -1
  29. package/esm/helpers/headingKeys.d.ts +2 -0
  30. package/esm/helpers/headingKeys.js +45 -0
  31. package/esm/helpers/headingKeys.js.map +1 -0
  32. package/esm/helpers/ids.js +1 -1
  33. package/esm/helpers/ids.js.map +1 -1
  34. package/esm/helpers/numberedShorthand.d.ts +1 -0
  35. package/esm/helpers/numberedShorthand.js +32 -0
  36. package/esm/helpers/numberedShorthand.js.map +1 -0
  37. package/esm/helpers/stripMarker.d.ts +1 -0
  38. package/esm/helpers/stripMarker.js +24 -0
  39. package/esm/helpers/stripMarker.js.map +1 -0
  40. package/esm/index.d.ts +5 -4
  41. package/esm/index.js +6 -5
  42. package/esm/index.js.map +1 -1
  43. package/esm/pluggableParser.js +35 -4
  44. package/esm/pluggableParser.js.map +1 -1
  45. package/esm/plugin-formatting-codes.js +44 -12
  46. package/esm/plugin-formatting-codes.js.map +1 -1
  47. package/esm/plugin-heading.js +3 -11
  48. package/esm/plugin-heading.js.map +1 -1
  49. package/esm/plugin-items.js +3 -32
  50. package/esm/plugin-items.js.map +1 -1
  51. package/esm/plugin-vmargin.js +16 -3
  52. package/esm/plugin-vmargin.js.map +1 -1
  53. package/esm/selectors.d.ts +3 -2
  54. package/esm/selectors.js +35 -4
  55. package/esm/selectors.js.map +1 -1
  56. package/esm/types.d.ts +30 -6
  57. package/esm/version.d.ts +1 -1
  58. package/esm/version.js +1 -1
  59. package/lib/ast-helpers.d.ts +2 -1
  60. package/lib/ast-helpers.js +31 -2
  61. package/lib/codes/place.d.ts +13 -0
  62. package/lib/codes/place.js +111 -0
  63. package/lib/codes/read.d.ts +21 -0
  64. package/lib/codes/read.js +369 -0
  65. package/lib/codes/scan.d.ts +41 -0
  66. package/lib/codes/scan.js +336 -0
  67. package/lib/exportHtml.js +43 -12
  68. package/lib/exportMarkdown.js +31 -8
  69. package/lib/guard.d.ts +9 -0
  70. package/lib/guard.js +104 -1
  71. package/lib/helpers/blockName.d.ts +1 -0
  72. package/lib/helpers/blockName.js +30 -3
  73. package/lib/helpers/configPropagation.js +3 -1
  74. package/lib/helpers/handlers.d.ts +3 -0
  75. package/lib/helpers/handlers.js +25 -1
  76. package/lib/helpers/headingKeys.d.ts +2 -0
  77. package/lib/helpers/headingKeys.js +50 -0
  78. package/lib/helpers/ids.js +1 -1
  79. package/lib/helpers/numberedShorthand.d.ts +1 -0
  80. package/lib/helpers/numberedShorthand.js +36 -0
  81. package/lib/helpers/stripMarker.d.ts +1 -0
  82. package/lib/helpers/stripMarker.js +28 -0
  83. package/lib/index.d.ts +5 -4
  84. package/lib/index.js +13 -3
  85. package/lib/pluggableParser.js +35 -4
  86. package/lib/plugin-formatting-codes.js +44 -45
  87. package/lib/plugin-heading.js +3 -11
  88. package/lib/plugin-items.js +4 -33
  89. package/lib/plugin-vmargin.js +16 -3
  90. package/lib/selectors.d.ts +3 -2
  91. package/lib/selectors.js +37 -5
  92. package/lib/types.d.ts +30 -6
  93. package/lib/version.d.ts +1 -1
  94. package/lib/version.js +1 -1
  95. package/package.json +2 -2
  96. package/schema/AstTree.json +174 -27
  97. package/schema/PodliteDocument.json +174 -27
  98. package/esm/grammarfc.d.ts +0 -14
  99. package/esm/grammarfc.js +0 -9824
  100. package/esm/grammarfc.js.map +0 -1
  101. package/lib/grammarfc.d.ts +0 -14
  102. package/lib/grammarfc.js +0 -9824
@@ -1,5 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ // the characters the grammar reads as indent; a tab moves on to the next multiple of 8
4
+ const INDENT = /^[ \u00a0\u2001\t\u000C\u2008]*/gm;
5
+ const TABSTOP = 8;
6
+ const widthOf = (indent) => [...indent].reduce((column, ch) => (ch === '\t' ? (Math.floor(column / TABSTOP) + 1) * TABSTOP : column + 1), 0);
7
+ // every line loses as many columns as the first one was set in by; what is left of
8
+ // its indent keeps its width
9
+ const takeIndent = (text, width) => text.replace(INDENT, indent => ' '.repeat(Math.max(0, widthOf(indent) - width)));
3
10
  const middle = () => tree => {
4
11
  const visit_node = (node, context = {}) => {
5
12
  // if( (node.type || "").match(/(code|text)/) ) {
@@ -9,9 +16,15 @@ const middle = () => tree => {
9
16
  node.type = 'para';
10
17
  }
11
18
  if (node.type === 'code') {
12
- // remove parent margin
13
- var regex = new RegExp(`^[ \t]{0,${node.margin.length}}`, 'gm');
14
- node.text = node.text.replace(regex, '');
19
+ // the indent that made the text code is its nesting, not part of it
20
+ const width = widthOf(node.margin);
21
+ node.text = takeIndent(node.text, width);
22
+ // the renderers write content, so it loses the indent text loses
23
+ const parts = node.content;
24
+ for (const part of parts) {
25
+ if (part.type === 'verbatim' && typeof part.value === 'string')
26
+ part.value = takeIndent(part.value, width);
27
+ }
15
28
  }
16
29
  }
17
30
  if (node.type === 'block') {
@@ -37,12 +37,13 @@ export type ValueSpec = {
37
37
  value: string;
38
38
  };
39
39
  export declare const parseSelector: (selector: string) => ParsedSelector | undefined;
40
+ export declare const readSelector: (selector: string) => ParsedSelector;
40
41
  export declare const outermost: (blocks: PodNode[]) => PodNode[];
41
42
  export declare const filePathMatches: (docFile: string, target: string) => boolean;
42
43
  export declare const getDocIDs: (doc: SelectorDoc) => string[];
43
44
  export declare class SelectorError extends Error {
44
- readonly kind: 'resolution' | 'format' | 'address';
45
- constructor(kind: 'resolution' | 'format' | 'address', message: string);
45
+ readonly kind: 'resolution' | 'format' | 'address' | 'syntax';
46
+ constructor(kind: 'resolution' | 'format' | 'address' | 'syntax', message: string);
46
47
  }
47
48
  export type SelectorOptions = {
48
49
  home?: SelectorDoc[];
package/lib/selectors.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.runSelector = exports.SelectorError = exports.getDocIDs = exports.filePathMatches = exports.outermost = exports.parseSelector = void 0;
3
+ exports.runSelector = exports.SelectorError = exports.getDocIDs = exports.filePathMatches = exports.outermost = exports.readSelector = exports.parseSelector = void 0;
4
4
  const index_1 = require("./index");
5
5
  const parseAttributes_1 = require("./helpers/parseAttributes");
6
6
  const blockName_1 = require("./helpers/blockName");
@@ -180,10 +180,12 @@ const parseCondition = (raw) => {
180
180
  const read = readAngleValue(s, i + 1);
181
181
  if (!read || read.end !== s.length)
182
182
  return undefined;
183
- // an empty list occurs among any values, so the condition would test nothing
184
183
  const operand = readOperand(read.value);
185
- if (!operand || valuesOf(operand).length === 0)
184
+ if (!operand)
186
185
  return undefined;
186
+ // an empty list occurs among any values, so the condition would test nothing
187
+ if (valuesOf(operand).length === 0)
188
+ throw new SelectorError('syntax', `the operand of :${attrName}~<> is empty`);
187
189
  return { modifier, attrName, valueSpec: { kind: 'contains', value: read.value } };
188
190
  }
189
191
  if (s[i] === '<') {
@@ -293,7 +295,7 @@ const parsePatternList = (filterPart) => {
293
295
  }
294
296
  return patterns;
295
297
  };
296
- const parseSelector = (selector) => {
298
+ const readParsed = (selector) => {
297
299
  const trimmed = selector.trim();
298
300
  if (!trimmed)
299
301
  return undefined;
@@ -345,7 +347,36 @@ const parseSelector = (selector) => {
345
347
  }
346
348
  return undefined;
347
349
  };
350
+ const parseSelector = (selector) => {
351
+ try {
352
+ return readParsed(selector);
353
+ }
354
+ catch (e) {
355
+ if (e instanceof SelectorError && e.kind === 'syntax')
356
+ return undefined;
357
+ throw e;
358
+ }
359
+ };
348
360
  exports.parseSelector = parseSelector;
361
+ /*
362
+ =begin pod :kind<export>
363
+
364
+ =head2 readSelector
365
+
366
+ Reads a selector as C<parseSelector> does, and throws a C<SelectorError> of the
367
+ kind C<syntax> instead of returning nothing when the selector cannot be read.
368
+ The message names an empty operand of C<~<>>; for any other reason it is
369
+ C<the selector cannot be read>.
370
+
371
+ =end pod
372
+ */
373
+ const readSelector = (selector) => {
374
+ const parsed = readParsed(selector);
375
+ if (!parsed)
376
+ throw new SelectorError('syntax', 'the selector cannot be read');
377
+ return parsed;
378
+ };
379
+ exports.readSelector = readSelector;
349
380
  // --- predicate matcher --------------------------------------------------
350
381
  // The declared value with its kind kept. makeAttrs flattens a list into the
351
382
  // surrounding values, which loses the very thing equality compares. What a
@@ -584,7 +615,8 @@ C<in>, cannot be read: its source does not resolve (C<resolution>), the format o
584
615
  the source is not known (C<format>), or the address is not in it (C<address>).
585
616
  Such a selection neither matches nor fails to match, so it returns nothing at all.
586
617
  A mask that no document answers is an empty source, not an error, unless it
587
- carries an address.
618
+ carries an address. C<readSelector> throws it with the kind C<syntax> when the
619
+ text of a selector cannot be read.
588
620
 
589
621
  =end pod
590
622
  */
package/lib/types.d.ts CHANGED
@@ -147,7 +147,7 @@ export interface RootBlock extends Omit<Block, 'location'> {
147
147
  }
148
148
  export interface ParseDiagnostic {
149
149
  severity: 'warning';
150
- code: 'value-unreadable' | 'directive-unreadable' | 'table-row-cells' | 'table-cell-outside-row' | 'table-mixed-separators' | 'table-source-unreadable' | 'table-source-empty' | 'table-source-deferred';
150
+ code: 'value-unreadable' | 'directive-unreadable' | 'table-row-cells' | 'table-cell-outside-row' | 'table-mixed-separators' | 'table-source-unreadable' | 'table-source-empty' | 'table-source-deferred' | 'markup-code-unclosed' | 'markup-code-longer-run' | 'markup-code-foreign-closer' | 'markup-code-reserved' | 'markup-code-unsupported' | 'markup-code-unreadable' | 'markup-code-entity-in-code';
151
151
  message: string;
152
152
  location: Location;
153
153
  }
@@ -206,17 +206,39 @@ export interface FormattingCodeX {
206
206
  export interface FormattingCodeZ {
207
207
  type: 'fcode';
208
208
  name: 'Z';
209
- content?: string | Text;
209
+ content?: Array<Node>;
210
210
  }
211
211
  export interface FormattingCodeV {
212
212
  type: 'fcode';
213
213
  name: 'V';
214
- content?: string | Text;
214
+ content?: Array<Node>;
215
215
  }
216
216
  export interface FormattingCodeS {
217
217
  type: 'fcode';
218
218
  name: 'S';
219
- content?: string | Text;
219
+ content?: Array<Node>;
220
+ }
221
+ export interface FormattingCodeM {
222
+ type: 'fcode';
223
+ name: 'M';
224
+ module: string | null;
225
+ config: unknown;
226
+ content: Array<Node>;
227
+ }
228
+ export interface FormattingCodeP {
229
+ type: 'fcode';
230
+ name: 'P';
231
+ content: Array<{
232
+ type: 'image';
233
+ src: string;
234
+ alt?: string;
235
+ }>;
236
+ }
237
+ export interface FormattingCodeReserved {
238
+ type: 'fcode';
239
+ name: 'Q' | 'Y';
240
+ written: [string, string];
241
+ content: Array<Node>;
220
242
  }
221
243
  export interface FormattingCodeA {
222
244
  type: 'fcode';
@@ -234,7 +256,8 @@ export interface FormattingCodeL {
234
256
  name: 'L';
235
257
  meta: string | null;
236
258
  config?: ConfigItem[];
237
- content: string | Text | [Text];
259
+ headingRef?: string;
260
+ content: string | Text | Text[];
238
261
  }
239
262
  export interface FormattingCodeW {
240
263
  type: 'fcode';
@@ -385,6 +408,7 @@ export interface BlockNested extends Block {
385
408
  export interface BlockHead extends Block {
386
409
  name: 'head';
387
410
  level: number | string;
411
+ headingKey?: string;
388
412
  }
389
413
  export interface BlockTable extends Omit<Block, 'content'> {
390
414
  name: 'table';
@@ -434,7 +458,7 @@ export interface BlockFormula extends Omit<BlockNamed, 'content'> {
434
458
  name: 'formula';
435
459
  content: [Verbatim];
436
460
  }
437
- export type FormattingCodes = FormattingCodeA | FormattingCodeC | FormattingCodeB | FormattingCodeD | FormattingCodeE | FormattingCodeF | FormattingCodeI | FormattingCodeL | FormattingCodeW | FormattingCodeN | FormattingCodeX | FormattingCodeZ | FormattingCodeV | FormattingCodeS | FormattingCodeAny;
461
+ export type FormattingCodes = FormattingCodeA | FormattingCodeC | FormattingCodeB | FormattingCodeD | FormattingCodeE | FormattingCodeF | FormattingCodeI | FormattingCodeL | FormattingCodeW | FormattingCodeN | FormattingCodeX | FormattingCodeZ | FormattingCodeV | FormattingCodeS | FormattingCodeM | FormattingCodeP | FormattingCodeReserved | FormattingCodeAny;
438
462
  export type PodNode = Ambient | BlockPod | BlockData | BlockFormula | BlockCode | BlankLine | BlockNested | BlockMarkdown | BlockOutput | BlockInput | BlockInclude | BlockPara | BlockHead | BlockComment | BlockDefn | string | Para | ParaTerm | ParaBuilt | Text | Code | BlockNamed | BlockAny | Verbatim | BlockTable | List | BlockConfig | BlockItem | Alias | BlockToc | BlockPicture | BlockImage | Image | RootBlock | Separator | BlockCaption | FormattingCodes | Toc;
439
463
  export type Node = PodNode;
440
464
  export type AstTree = Array<PodNode>;
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "0.0.74";
1
+ export declare const version = "0.0.76";
package/lib/version.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = void 0;
4
4
  // generated by scripts/inject-version.mjs — do not edit by hand
5
- exports.version = '0.0.74';
5
+ exports.version = '0.0.76';
6
6
  //# sourceMappingURL=version.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@podlite/schema",
3
- "version": "0.0.74",
3
+ "version": "0.0.76",
4
4
  "description": "AST tools and schema for Podlite markup language — validate, traverse, and transform document trees",
5
5
  "main": "./lib/index.js",
6
6
  "sideEffects": false,
@@ -48,7 +48,7 @@
48
48
  "inject-version": "yarn g:inject-version",
49
49
  "build_lib": "yarn g:build",
50
50
  "build:ast": "ts-node scripts/make-ast-scheme.ts",
51
- "build:pegjs": "pegmill --allowed-start-rules Document,attributesOnly -o src/grammar.js src/grammar.pegjs && pegmill -o src/grammarfc.js src/grammarfc.pegjs",
51
+ "build:pegjs": "pegmill --allowed-start-rules Document,attributesOnly -o src/grammar.js src/grammar.pegjs",
52
52
  "watch": "npx nodemon -e js,ts --exec 'yarn' build",
53
53
  "watch:pegjs": "npx nodemon -e pegmill --exec 'yarn' build:pegjs",
54
54
  "test": "yarn g:jest --passWithNoTests"
@@ -147,6 +147,15 @@
147
147
  {
148
148
  "$ref": "#/definitions/FormattingCodeS"
149
149
  },
150
+ {
151
+ "$ref": "#/definitions/FormattingCodeM"
152
+ },
153
+ {
154
+ "$ref": "#/definitions/FormattingCodeP"
155
+ },
156
+ {
157
+ "$ref": "#/definitions/FormattingCodeReserved"
158
+ },
150
159
  {
151
160
  "$ref": "#/definitions/FormattingCodeAny"
152
161
  },
@@ -952,6 +961,9 @@
952
961
  "number"
953
962
  ]
954
963
  },
964
+ "headingKey": {
965
+ "type": "string"
966
+ },
955
967
  "type": {
956
968
  "type": "string",
957
969
  "const": "block"
@@ -1287,6 +1299,15 @@
1287
1299
  {
1288
1300
  "$ref": "#/definitions/FormattingCodeS"
1289
1301
  },
1302
+ {
1303
+ "$ref": "#/definitions/FormattingCodeM"
1304
+ },
1305
+ {
1306
+ "$ref": "#/definitions/FormattingCodeP"
1307
+ },
1308
+ {
1309
+ "$ref": "#/definitions/FormattingCodeReserved"
1310
+ },
1290
1311
  {
1291
1312
  "$ref": "#/definitions/FormattingCodeAny"
1292
1313
  },
@@ -1470,6 +1491,15 @@
1470
1491
  {
1471
1492
  "$ref": "#/definitions/FormattingCodeS"
1472
1493
  },
1494
+ {
1495
+ "$ref": "#/definitions/FormattingCodeM"
1496
+ },
1497
+ {
1498
+ "$ref": "#/definitions/FormattingCodeP"
1499
+ },
1500
+ {
1501
+ "$ref": "#/definitions/FormattingCodeReserved"
1502
+ },
1473
1503
  {
1474
1504
  "$ref": "#/definitions/FormattingCodeAny"
1475
1505
  },
@@ -1645,6 +1675,15 @@
1645
1675
  {
1646
1676
  "$ref": "#/definitions/FormattingCodeS"
1647
1677
  },
1678
+ {
1679
+ "$ref": "#/definitions/FormattingCodeM"
1680
+ },
1681
+ {
1682
+ "$ref": "#/definitions/FormattingCodeP"
1683
+ },
1684
+ {
1685
+ "$ref": "#/definitions/FormattingCodeReserved"
1686
+ },
1648
1687
  {
1649
1688
  "$ref": "#/definitions/FormattingCodeAny"
1650
1689
  },
@@ -1861,6 +1900,13 @@
1861
1900
  "code": {
1862
1901
  "enum": [
1863
1902
  "directive-unreadable",
1903
+ "markup-code-entity-in-code",
1904
+ "markup-code-foreign-closer",
1905
+ "markup-code-longer-run",
1906
+ "markup-code-reserved",
1907
+ "markup-code-unclosed",
1908
+ "markup-code-unreadable",
1909
+ "markup-code-unsupported",
1864
1910
  "table-cell-outside-row",
1865
1911
  "table-mixed-separators",
1866
1912
  "table-row-cells",
@@ -2776,6 +2822,9 @@
2776
2822
  "$ref": "#/definitions/ConfigItem"
2777
2823
  }
2778
2824
  },
2825
+ "headingRef": {
2826
+ "type": "string"
2827
+ },
2779
2828
  "content": {
2780
2829
  "anyOf": [
2781
2830
  {
@@ -2783,13 +2832,9 @@
2783
2832
  },
2784
2833
  {
2785
2834
  "type": "array",
2786
- "items": [
2787
- {
2788
- "$ref": "#/definitions/Text"
2789
- }
2790
- ],
2791
- "minItems": 1,
2792
- "maxItems": 1
2835
+ "items": {
2836
+ "$ref": "#/definitions/Text"
2837
+ }
2793
2838
  },
2794
2839
  {
2795
2840
  "type": "string"
@@ -2913,14 +2958,10 @@
2913
2958
  "const": "Z"
2914
2959
  },
2915
2960
  "content": {
2916
- "anyOf": [
2917
- {
2918
- "$ref": "#/definitions/Text"
2919
- },
2920
- {
2921
- "type": "string"
2922
- }
2923
- ]
2961
+ "type": "array",
2962
+ "items": {
2963
+ "$ref": "#/definitions/PodNode"
2964
+ }
2924
2965
  }
2925
2966
  },
2926
2967
  "required": [
@@ -2940,14 +2981,10 @@
2940
2981
  "const": "V"
2941
2982
  },
2942
2983
  "content": {
2943
- "anyOf": [
2944
- {
2945
- "$ref": "#/definitions/Text"
2946
- },
2947
- {
2948
- "type": "string"
2949
- }
2950
- ]
2984
+ "type": "array",
2985
+ "items": {
2986
+ "$ref": "#/definitions/PodNode"
2987
+ }
2951
2988
  }
2952
2989
  },
2953
2990
  "required": [
@@ -2967,19 +3004,129 @@
2967
3004
  "const": "S"
2968
3005
  },
2969
3006
  "content": {
2970
- "anyOf": [
3007
+ "type": "array",
3008
+ "items": {
3009
+ "$ref": "#/definitions/PodNode"
3010
+ }
3011
+ }
3012
+ },
3013
+ "required": [
3014
+ "name",
3015
+ "type"
3016
+ ]
3017
+ },
3018
+ "FormattingCodeM": {
3019
+ "type": "object",
3020
+ "properties": {
3021
+ "type": {
3022
+ "type": "string",
3023
+ "const": "fcode"
3024
+ },
3025
+ "name": {
3026
+ "type": "string",
3027
+ "const": "M"
3028
+ },
3029
+ "module": {
3030
+ "type": [
3031
+ "null",
3032
+ "string"
3033
+ ]
3034
+ },
3035
+ "config": {},
3036
+ "content": {
3037
+ "type": "array",
3038
+ "items": {
3039
+ "$ref": "#/definitions/PodNode"
3040
+ }
3041
+ }
3042
+ },
3043
+ "required": [
3044
+ "config",
3045
+ "content",
3046
+ "module",
3047
+ "name",
3048
+ "type"
3049
+ ]
3050
+ },
3051
+ "FormattingCodeP": {
3052
+ "type": "object",
3053
+ "properties": {
3054
+ "type": {
3055
+ "type": "string",
3056
+ "const": "fcode"
3057
+ },
3058
+ "name": {
3059
+ "type": "string",
3060
+ "const": "P"
3061
+ },
3062
+ "content": {
3063
+ "type": "array",
3064
+ "items": {
3065
+ "type": "object",
3066
+ "properties": {
3067
+ "type": {
3068
+ "type": "string",
3069
+ "const": "image"
3070
+ },
3071
+ "src": {
3072
+ "type": "string"
3073
+ },
3074
+ "alt": {
3075
+ "type": "string"
3076
+ }
3077
+ },
3078
+ "required": [
3079
+ "src",
3080
+ "type"
3081
+ ]
3082
+ }
3083
+ }
3084
+ },
3085
+ "required": [
3086
+ "content",
3087
+ "name",
3088
+ "type"
3089
+ ]
3090
+ },
3091
+ "FormattingCodeReserved": {
3092
+ "type": "object",
3093
+ "properties": {
3094
+ "type": {
3095
+ "type": "string",
3096
+ "const": "fcode"
3097
+ },
3098
+ "name": {
3099
+ "enum": [
3100
+ "Q",
3101
+ "Y"
3102
+ ],
3103
+ "type": "string"
3104
+ },
3105
+ "written": {
3106
+ "type": "array",
3107
+ "items": [
2971
3108
  {
2972
- "$ref": "#/definitions/Text"
3109
+ "type": "string"
2973
3110
  },
2974
3111
  {
2975
3112
  "type": "string"
2976
3113
  }
2977
- ]
3114
+ ],
3115
+ "minItems": 2,
3116
+ "maxItems": 2
3117
+ },
3118
+ "content": {
3119
+ "type": "array",
3120
+ "items": {
3121
+ "$ref": "#/definitions/PodNode"
3122
+ }
2978
3123
  }
2979
3124
  },
2980
3125
  "required": [
3126
+ "content",
2981
3127
  "name",
2982
- "type"
3128
+ "type",
3129
+ "written"
2983
3130
  ]
2984
3131
  },
2985
3132
  "FormattingCodeAny": {