@podlite/schema 0.0.13 → 0.0.15
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.
- package/CHANGELOG.md +7 -0
- package/esm/ast-helpers.d.ts +2 -0
- package/esm/ast-helpers.js +10 -0
- package/esm/ast-helpers.js.map +1 -0
- package/esm/ast-inerator.d.ts +6 -0
- package/esm/ast-inerator.js +57 -0
- package/esm/ast-inerator.js.map +1 -0
- package/esm/blocks-helpers.d.ts +32 -0
- package/esm/blocks-helpers.js +65 -0
- package/esm/blocks-helpers.js.map +1 -0
- package/esm/exportAny.d.ts +19 -0
- package/esm/exportAny.js +65 -0
- package/esm/exportAny.js.map +1 -0
- package/esm/exportHtml.d.ts +15 -0
- package/esm/exportHtml.js +279 -0
- package/esm/exportHtml.js.map +1 -0
- package/esm/grammar.d.ts +14 -0
- package/esm/grammar.js +6404 -0
- package/esm/grammar.js.map +1 -0
- package/esm/grammarfc.d.ts +14 -0
- package/esm/grammarfc.js +4218 -0
- package/esm/grammarfc.js.map +1 -0
- package/esm/helpers/config.d.ts +12 -0
- package/esm/helpers/config.js +52 -0
- package/esm/helpers/config.js.map +1 -0
- package/esm/helpers/corePlugins.d.ts +12 -0
- package/esm/helpers/corePlugins.js +23 -0
- package/esm/helpers/corePlugins.js.map +1 -0
- package/esm/helpers/handlers.d.ts +47 -0
- package/esm/helpers/handlers.js +107 -0
- package/esm/helpers/handlers.js.map +1 -0
- package/esm/helpers/ids.d.ts +18 -0
- package/esm/helpers/ids.js +69 -0
- package/esm/helpers/ids.js.map +1 -0
- package/esm/helpers/makeInterator.d.ts +5 -0
- package/esm/helpers/makeInterator.js +52 -0
- package/esm/helpers/makeInterator.js.map +1 -0
- package/esm/helpers/makeQuery.d.ts +47 -0
- package/esm/helpers/makeQuery.js +100 -0
- package/esm/helpers/makeQuery.js.map +1 -0
- package/esm/helpers/makeQuery.test.d.ts +1 -0
- package/esm/helpers/makeQuery.test.js +51 -0
- package/esm/helpers/makeQuery.test.js.map +1 -0
- package/esm/helpers/makeTransformer.d.ts +7 -0
- package/esm/helpers/makeTransformer.js +61 -0
- package/esm/helpers/makeTransformer.js.map +1 -0
- package/esm/helpers/plugins.d.ts +2 -0
- package/esm/helpers/plugins.js +23 -0
- package/esm/helpers/plugins.js.map +1 -0
- package/esm/index.d.ts +82 -0
- package/esm/index.js +123 -0
- package/esm/index.js.map +1 -0
- package/esm/pluggableParser.d.ts +27 -0
- package/esm/pluggableParser.js +71 -0
- package/esm/pluggableParser.js.map +1 -0
- package/esm/plugin-clean-location.d.ts +2 -0
- package/esm/plugin-clean-location.js +19 -0
- package/esm/plugin-clean-location.js.map +1 -0
- package/esm/plugin-defn-fill-term.d.ts +2 -0
- package/esm/plugin-defn-fill-term.js +50 -0
- package/esm/plugin-defn-fill-term.js.map +1 -0
- package/esm/plugin-formatting-codes.d.ts +3 -0
- package/esm/plugin-formatting-codes.js +53 -0
- package/esm/plugin-formatting-codes.js.map +1 -0
- package/esm/plugin-group-defn.d.ts +2 -0
- package/esm/plugin-group-defn.js +71 -0
- package/esm/plugin-group-defn.js.map +1 -0
- package/esm/plugin-group-items.d.ts +2 -0
- package/esm/plugin-group-items.js +79 -0
- package/esm/plugin-group-items.js.map +1 -0
- package/esm/plugin-heading.d.ts +2 -0
- package/esm/plugin-heading.js +33 -0
- package/esm/plugin-heading.js.map +1 -0
- package/esm/plugin-items.d.ts +2 -0
- package/esm/plugin-items.js +41 -0
- package/esm/plugin-items.js.map +1 -0
- package/esm/plugin-tables.d.ts +5 -0
- package/esm/plugin-tables.js +141 -0
- package/esm/plugin-tables.js.map +1 -0
- package/esm/plugin-vmargin.d.ts +3 -0
- package/esm/plugin-vmargin.js +29 -0
- package/esm/plugin-vmargin.js.map +1 -0
- package/esm/query-helpers.d.ts +28 -0
- package/esm/query-helpers.js +131 -0
- package/esm/query-helpers.js.map +1 -0
- package/esm/types.d.ts +342 -0
- package/esm/types.js +2 -0
- package/esm/types.js.map +1 -0
- package/esm/writer.d.ts +30 -0
- package/esm/writer.js +85 -0
- package/esm/writer.js.map +1 -0
- package/esm/writerHtml.d.ts +11 -0
- package/esm/writerHtml.js +29 -0
- package/esm/writerHtml.js.map +1 -0
- package/lib/grammar.js +29 -21
- package/lib/grammarfc.js +1098 -243
- package/lib/plugin-formatting-codes.js +2 -1
- package/lib/types.d.ts +9 -1
- package/package.json +11 -8
- package/schema/AstTree.json +116 -0
- package/schema/PodliteDocument.json +116 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writer.js","sourceRoot":"","sources":["../src/writer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAA;AAEhC,MAAM,MAAO,SAAQ,MAAM,CAAC,YAAY;IACtC,UAAU,CAAO;IACjB,SAAS,CAAO;IAChB,MAAM,CAAK;IACX,MAAM,CAAK;IACX,GAAG,CAAK;IACR,GAAG,CAAO;IACV,2BAA2B;IAC3B,2EAA2E;IAC3E,eAAe;IACf,YAAY;IACZ,0BAA0B;IAC1B,cAAc;IACd,wBAAwB;IAExB,YAAY,MAAO;QACjB,KAAK,EAAE,CAAA;QACP,mBAAmB;QACnB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAA;QACpB,qBAAqB;QACrB,IAAI,CAAC,SAAS,GAAG,EAAE,CAAA;QACnB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAA;QACb,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACpB,CAAC;IACD,6BAA6B;IAC7B,MAAM,CAAC,CAAC;QACN,OAAO,CAAC,CAAA;IACV,CAAC;IACD,oCAAoC;IACpC,KAAK,CAAC,CAAC;QACL,OAAO,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACtC,CAAC;IACD,kBAAkB;IAClB,QAAQ,CAAC,GAAG;QACV,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C,CAAS,IAAG,CAAC;IAE7B,QAAQ,CAAC,CAAS;QAChB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAA;IACtB,CAAC;IAED,WAAW,CAAC,CAAS;QACnB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IACzB,CAAC;CACF;AAED,eAAe,MAAM,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML writer
|
|
3
|
+
*/
|
|
4
|
+
import Writer from './writer';
|
|
5
|
+
declare class WriterHTML extends Writer {
|
|
6
|
+
constructor(output?: any);
|
|
7
|
+
escape(string: any): string;
|
|
8
|
+
_add_nesting(n: any): void;
|
|
9
|
+
_remove_nesting(n: any): void;
|
|
10
|
+
}
|
|
11
|
+
export default WriterHTML;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTML writer
|
|
3
|
+
*/
|
|
4
|
+
import Writer from './writer';
|
|
5
|
+
class WriterHTML extends Writer {
|
|
6
|
+
constructor(output) {
|
|
7
|
+
super(output);
|
|
8
|
+
}
|
|
9
|
+
escape(string) {
|
|
10
|
+
const HTML_CHARS = {
|
|
11
|
+
'&': '&',
|
|
12
|
+
'<': '<',
|
|
13
|
+
'>': '>',
|
|
14
|
+
'"': '"',
|
|
15
|
+
"'": ''',
|
|
16
|
+
'/': '/',
|
|
17
|
+
'`': '`',
|
|
18
|
+
};
|
|
19
|
+
return (string + '').replace(/[&<>"'\/`]/g, match => HTML_CHARS[match]);
|
|
20
|
+
}
|
|
21
|
+
_add_nesting(n) {
|
|
22
|
+
this.writeRaw('<blockquote>'.repeat(n));
|
|
23
|
+
}
|
|
24
|
+
_remove_nesting(n) {
|
|
25
|
+
this.writeRaw('</blockquote>'.repeat(n));
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export default WriterHTML;
|
|
29
|
+
//# sourceMappingURL=writerHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"writerHtml.js","sourceRoot":"","sources":["../src/writerHtml.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,MAAM,MAAM,UAAU,CAAA;AAC7B,MAAM,UAAW,SAAQ,MAAM;IAC7B,YAAY,MAAO;QACjB,KAAK,CAAC,MAAM,CAAC,CAAA;IACf,CAAC;IACD,MAAM,CAAC,MAAM;QACX,MAAM,UAAU,GAAG;YACjB,GAAG,EAAE,OAAO;YACZ,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,MAAM;YACX,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;YACb,GAAG,EAAE,QAAQ;SACd,CAAA;QACD,OAAO,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAA;IACzE,CAAC;IAED,YAAY,CAAC,CAAC;QACZ,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IACzC,CAAC;IACD,eAAe,CAAC,CAAC;QACf,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAA;IAC1C,CAAC;CACF;AACD,eAAe,UAAU,CAAA"}
|
package/lib/grammar.js
CHANGED
|
@@ -134,7 +134,7 @@ function peg$parse(input, options) {
|
|
|
134
134
|
type: "boolean"
|
|
135
135
|
};
|
|
136
136
|
}, peg$c88 = function (isFalse, key, value) { return { name: key, ...value }; }, peg$c89 = function (first, rest) { return rest; }, peg$c90 = function (first, cont) { return flattenDeep([...first, ...cont]); }, peg$c91 = /^[^'"]/, peg$c92 = peg$classExpectation(["'", "\""], true, false), peg$c93 = function (text) { return text; }, peg$c94 = /^[0-9]/, peg$c95 = peg$classExpectation([["0", "9"]], false, false), peg$c96 = /^[\-+]/, peg$c97 = peg$classExpectation(["-", "+"], false, false), peg$c98 = "True", peg$c99 = peg$literalExpectation("True", false), peg$c100 = function () { return true; }, peg$c101 = "False", peg$c102 = peg$literalExpectation("False", false), peg$c103 = function () { return false; }, peg$c104 = ".", peg$c105 = peg$literalExpectation(".", false), peg$c106 = /^[eE]/, peg$c107 = peg$classExpectation(["e", "E"], false, false), peg$c108 = /^["]/, peg$c109 = peg$classExpectation(["\""], false, false), peg$c110 = /^[^"]/, peg$c111 = peg$classExpectation(["\""], true, false), peg$c112 = /^[']/, peg$c113 = peg$classExpectation(["'"], false, false), peg$c114 = /^[^']/, peg$c115 = peg$classExpectation(["'"], true, false), peg$c116 = function (numberFloat) { return parseFloat(numberFloat); }, peg$c117 = function (number) { return parseInt(number, 10); }, peg$c118 = function (vmargin, name, config) {
|
|
137
|
-
return ((name.match(/code|comment|output|input|data/))
|
|
137
|
+
return ((name.match(/code|comment|output|input|markdown|toc|data/))
|
|
138
138
|
||
|
|
139
139
|
isNamedBlock(name));
|
|
140
140
|
}, peg$c119 = function (vmargin, name, config, margins, ename) { return vmargin.length === margins.length && name === ename; }, peg$c120 = function (vmargin, name, config, margins, line) { return exludeVMargin(vmargin, `${margins}${line}`); }, peg$c121 = function (vmargin, name, config, content, vmargin2, ename) { return name === ename; }, peg$c122 = function (vmargin, name, config, content, vmargin2, ename) {
|
|
@@ -261,7 +261,7 @@ function peg$parse(input, options) {
|
|
|
261
261
|
location: location(),
|
|
262
262
|
};
|
|
263
263
|
}, peg$c150 = function () { return { empty: 1 }; }, peg$c151 = /^[s]/, peg$c152 = peg$classExpectation(["s"], false, false), peg$c153 = function (line) { return { text: text(), type: "ambient1" }; }, peg$c154 = function (vmargin, name) {
|
|
264
|
-
return ((name.match(/code|comment|output|input|data/))
|
|
264
|
+
return ((name.match(/code|comment|output|input|markdown|toc|data/))
|
|
265
265
|
||
|
|
266
266
|
isNamedBlock(name));
|
|
267
267
|
}, peg$c155 = function (vmargin, name, content) {
|
|
@@ -320,7 +320,7 @@ function peg$parse(input, options) {
|
|
|
320
320
|
margin: vmargin
|
|
321
321
|
};
|
|
322
322
|
}, peg$c168 = function (vmargin, marker, name, config) {
|
|
323
|
-
return ((name.match(/code|comment|output|input|data/))
|
|
323
|
+
return ((name.match(/code|comment|output|input|markdown|toc|data/))
|
|
324
324
|
||
|
|
325
325
|
isNamedBlock(name));
|
|
326
326
|
}, peg$c169 = function (vmargin, marker, name, config, content) {
|
|
@@ -1171,25 +1171,31 @@ function peg$parse(input, options) {
|
|
|
1171
1171
|
s2 = peg$currPos;
|
|
1172
1172
|
s3 = peg$parse_();
|
|
1173
1173
|
if (s3 !== peg$FAILED) {
|
|
1174
|
-
s4 = peg$
|
|
1175
|
-
s5 = peg$parsemarkers();
|
|
1176
|
-
if (s5 !== peg$FAILED) {
|
|
1177
|
-
s6 = peg$parsestrictIdentifier();
|
|
1178
|
-
if (s6 !== peg$FAILED) {
|
|
1179
|
-
s5 = [s5, s6];
|
|
1180
|
-
s4 = s5;
|
|
1181
|
-
}
|
|
1182
|
-
else {
|
|
1183
|
-
peg$currPos = s4;
|
|
1184
|
-
s4 = peg$FAILED;
|
|
1185
|
-
}
|
|
1186
|
-
}
|
|
1187
|
-
else {
|
|
1188
|
-
peg$currPos = s4;
|
|
1189
|
-
s4 = peg$FAILED;
|
|
1190
|
-
}
|
|
1174
|
+
s4 = peg$parsemarkerConfig();
|
|
1191
1175
|
if (s4 === peg$FAILED) {
|
|
1192
|
-
s4 = peg$
|
|
1176
|
+
s4 = peg$parsemarkerAlias();
|
|
1177
|
+
if (s4 === peg$FAILED) {
|
|
1178
|
+
s4 = peg$currPos;
|
|
1179
|
+
s5 = peg$parsemarkers();
|
|
1180
|
+
if (s5 !== peg$FAILED) {
|
|
1181
|
+
s6 = peg$parsestrictIdentifier();
|
|
1182
|
+
if (s6 !== peg$FAILED) {
|
|
1183
|
+
s5 = [s5, s6];
|
|
1184
|
+
s4 = s5;
|
|
1185
|
+
}
|
|
1186
|
+
else {
|
|
1187
|
+
peg$currPos = s4;
|
|
1188
|
+
s4 = peg$FAILED;
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
else {
|
|
1192
|
+
peg$currPos = s4;
|
|
1193
|
+
s4 = peg$FAILED;
|
|
1194
|
+
}
|
|
1195
|
+
if (s4 === peg$FAILED) {
|
|
1196
|
+
s4 = peg$parsemarkerAbbreviatedBlock();
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1193
1199
|
}
|
|
1194
1200
|
if (s4 !== peg$FAILED) {
|
|
1195
1201
|
s3 = [s3, s4];
|
|
@@ -6354,11 +6360,13 @@ function peg$parse(input, options) {
|
|
|
6354
6360
|
'head',
|
|
6355
6361
|
'input',
|
|
6356
6362
|
'item',
|
|
6363
|
+
'markdown',
|
|
6357
6364
|
'nested',
|
|
6358
6365
|
'output',
|
|
6359
6366
|
'para',
|
|
6360
6367
|
'pod',
|
|
6361
6368
|
'table',
|
|
6369
|
+
'toc',
|
|
6362
6370
|
].includes(name)
|
|
6363
6371
|
||
|
|
6364
6372
|
isSemanticBlock(name)
|