@markdoc/markdoc 0.1.7 → 0.1.8
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/README.md +13 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +81 -22
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +81 -22
- package/dist/index.mjs.map +3 -3
- package/dist/src/parser.d.ts.map +1 -1
- package/dist/src/schema.d.ts +8 -0
- package/dist/src/schema.d.ts.map +1 -1
- package/dist/src/tokenizer/index.d.ts +1 -0
- package/dist/src/tokenizer/index.d.ts.map +1 -1
- package/dist/src/tokenizer/plugins/comments.d.ts +3 -0
- package/dist/src/tokenizer/plugins/comments.d.ts.map +1 -0
- package/dist/src/types.d.ts +4 -3
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/validator.d.ts +1 -1
- package/dist/src/validator.d.ts.map +1 -1
- package/index.ts +20 -7
- package/package.json +6 -4
- package/src/parser.test.ts +17 -1
- package/src/parser.ts +1 -0
- package/src/schema.ts +8 -0
- package/src/tokenizer/index.ts +7 -1
- package/src/tokenizer/plugins/comments.test.ts +94 -0
- package/src/tokenizer/plugins/comments.ts +51 -0
- package/src/types.ts +4 -3
- package/src/validator.test.ts +30 -1
- package/src/validator.ts +11 -3
package/README.md
CHANGED
|
@@ -52,6 +52,19 @@ return Markdoc.renderers.react(content, React);
|
|
|
52
52
|
|
|
53
53
|
Check out [our docs](https://markdoc.dev/docs) for more guidance on how to use Markdoc.
|
|
54
54
|
|
|
55
|
+
### TypeScript
|
|
56
|
+
This is the minimal `tsconfig.json` in order to use Markdoc in your TypeScript project
|
|
57
|
+
|
|
58
|
+
```json
|
|
59
|
+
{
|
|
60
|
+
"compilerOptions": {
|
|
61
|
+
"moduleResolution": "node",
|
|
62
|
+
"target": "esnext", // works with es2015 or greater
|
|
63
|
+
"esModuleInterop": true
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
```
|
|
67
|
+
|
|
55
68
|
## Contributing
|
|
56
69
|
|
|
57
70
|
Contributions and feedback are welcome and encouraged. Check out our [contributing guidelines](.github/CONTRIBUTING.md) on how to do so.
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export declare function resolve<C extends Config = Config>(content: Node, config
|
|
|
20
20
|
export declare function resolve<C extends Config = Config>(content: Node[], config: C): Node[];
|
|
21
21
|
export declare function transform<C extends Config = Config>(node: Node, config?: C): RenderableTreeNode;
|
|
22
22
|
export declare function transform<C extends Config = Config>(nodes: Node[], config?: C): RenderableTreeNode[];
|
|
23
|
-
export declare function validate<C extends Config = Config>(
|
|
23
|
+
export declare function validate<C extends Config = Config>(node: Node, options?: C): ValidateError[];
|
|
24
24
|
export declare function createElement(name: string | {
|
|
25
25
|
key?: string | number;
|
|
26
26
|
}, attributes?: {}, ...children: any[]): {
|
|
@@ -94,7 +94,7 @@ export default class Markdoc {
|
|
|
94
94
|
fromJSON: (text: string) => Node | Node[];
|
|
95
95
|
isAst(value?: any): value is import("./src/types").AstType;
|
|
96
96
|
isFunction(value?: any): value is import("./src/ast/function").default;
|
|
97
|
-
isVariable(value?: any): value is import("./src/
|
|
97
|
+
isVariable(value?: any): value is import("./src/ast/variable").default;
|
|
98
98
|
getAstValues(value: any): Generator<import("./src/types").AstType, void, unknown>;
|
|
99
99
|
resolve(value: any, config?: Readonly<Partial<{
|
|
100
100
|
nodes: Partial<Record<import("./src/types").NodeType, import("./src/types").Schema<Readonly<Partial<any>>, string>>>;
|
|
@@ -108,7 +108,7 @@ export default class Markdoc {
|
|
|
108
108
|
}>>): any;
|
|
109
109
|
Function: typeof import("./src/ast/function").default;
|
|
110
110
|
Node: typeof Node;
|
|
111
|
-
Variable: typeof import("./src/
|
|
111
|
+
Variable: typeof import("./src/ast/variable").default;
|
|
112
112
|
};
|
|
113
113
|
static Tag: typeof Tag;
|
|
114
114
|
static Tokenizer: typeof Tokenizer;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,sBAAsB,MAAM,iBAAiB,CAAC;AACrD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AAExC,OAAO,KAAK,KAAK,MAAM,cAAc,CAAC;AACtC,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,GAAG,MAAM,WAAW,CAAC;AAC5B,OAAO,IAAI,MAAM,YAAY,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,SAAS,MAAM,iBAAiB,CAAC;AACxC,OAAO,WAAW,EAAE,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAClE,OAAO,UAAU,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"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"}
|
package/dist/index.js
CHANGED
|
@@ -2798,7 +2798,7 @@ var require_normalize = __commonJS({
|
|
|
2798
2798
|
var require_block = __commonJS({
|
|
2799
2799
|
"node_modules/markdown-it/lib/rules_core/block.js"(exports, module2) {
|
|
2800
2800
|
"use strict";
|
|
2801
|
-
module2.exports = function
|
|
2801
|
+
module2.exports = function block4(state) {
|
|
2802
2802
|
var token;
|
|
2803
2803
|
if (state.inlineMode) {
|
|
2804
2804
|
token = new state.Token("inline", "", 0);
|
|
@@ -2817,7 +2817,7 @@ var require_block = __commonJS({
|
|
|
2817
2817
|
var require_inline = __commonJS({
|
|
2818
2818
|
"node_modules/markdown-it/lib/rules_core/inline.js"(exports, module2) {
|
|
2819
2819
|
"use strict";
|
|
2820
|
-
module2.exports = function
|
|
2820
|
+
module2.exports = function inline4(state) {
|
|
2821
2821
|
var tokens = state.tokens, tok, i, l;
|
|
2822
2822
|
for (i = 0, l = tokens.length; i < l; i++) {
|
|
2823
2823
|
tok = tokens[i];
|
|
@@ -4221,11 +4221,11 @@ var require_html_re = __commonJS({
|
|
|
4221
4221
|
var attribute = "(?:\\s+" + attr_name + "(?:\\s*=\\s*" + attr_value + ")?)";
|
|
4222
4222
|
var open_tag = "<[A-Za-z][A-Za-z0-9\\-]*" + attribute + "*\\s*\\/?>";
|
|
4223
4223
|
var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
|
|
4224
|
-
var
|
|
4224
|
+
var comment2 = "<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->";
|
|
4225
4225
|
var processing = "<[?][\\s\\S]*?[?]>";
|
|
4226
4226
|
var declaration = "<![A-Z]+\\s+[^>]*>";
|
|
4227
4227
|
var cdata = "<!\\[CDATA\\[[\\s\\S]*?\\]\\]>";
|
|
4228
|
-
var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" +
|
|
4228
|
+
var HTML_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + "|" + comment2 + "|" + processing + "|" + declaration + "|" + cdata + ")");
|
|
4229
4229
|
var HTML_OPEN_CLOSE_TAG_RE = new RegExp("^(?:" + open_tag + "|" + close_tag + ")");
|
|
4230
4230
|
module2.exports.HTML_TAG_RE = HTML_TAG_RE;
|
|
4231
4231
|
module2.exports.HTML_OPEN_CLOSE_TAG_RE = HTML_OPEN_CLOSE_TAG_RE;
|
|
@@ -6559,9 +6559,9 @@ var require_lib = __commonJS({
|
|
|
6559
6559
|
}
|
|
6560
6560
|
return this;
|
|
6561
6561
|
};
|
|
6562
|
-
MarkdownIt3.prototype.use = function(
|
|
6562
|
+
MarkdownIt3.prototype.use = function(plugin4) {
|
|
6563
6563
|
var args = [this].concat(Array.prototype.slice.call(arguments, 1));
|
|
6564
|
-
|
|
6564
|
+
plugin4.apply(plugin4, args);
|
|
6565
6565
|
return this;
|
|
6566
6566
|
};
|
|
6567
6567
|
MarkdownIt3.prototype.parse = function(src, env) {
|
|
@@ -6618,8 +6618,8 @@ __export(exports, {
|
|
|
6618
6618
|
transformer: () => transformer_default,
|
|
6619
6619
|
transforms: () => transforms_default,
|
|
6620
6620
|
truthy: () => truthy,
|
|
6621
|
-
validate: () =>
|
|
6622
|
-
validator: () =>
|
|
6621
|
+
validate: () => validate,
|
|
6622
|
+
validator: () => validator
|
|
6623
6623
|
});
|
|
6624
6624
|
|
|
6625
6625
|
// src/ast/base.ts
|
|
@@ -7468,6 +7468,7 @@ function handleAttrs(token, type) {
|
|
|
7468
7468
|
}
|
|
7469
7469
|
case "text":
|
|
7470
7470
|
case "code":
|
|
7471
|
+
case "comment":
|
|
7471
7472
|
return { content: (token.meta || {}).variable || token.content };
|
|
7472
7473
|
case "fence": {
|
|
7473
7474
|
const [language] = token.info.split(" ", 1);
|
|
@@ -7591,6 +7592,7 @@ var schema_exports = {};
|
|
|
7591
7592
|
__export(schema_exports, {
|
|
7592
7593
|
blockquote: () => blockquote,
|
|
7593
7594
|
code: () => code,
|
|
7595
|
+
comment: () => comment,
|
|
7594
7596
|
document: () => document,
|
|
7595
7597
|
em: () => em,
|
|
7596
7598
|
error: () => error,
|
|
@@ -7626,6 +7628,7 @@ var document = {
|
|
|
7626
7628
|
"tag",
|
|
7627
7629
|
"fence",
|
|
7628
7630
|
"blockquote",
|
|
7631
|
+
"comment",
|
|
7629
7632
|
"list",
|
|
7630
7633
|
"hr"
|
|
7631
7634
|
],
|
|
@@ -7773,7 +7776,8 @@ var inline = {
|
|
|
7773
7776
|
"link",
|
|
7774
7777
|
"image",
|
|
7775
7778
|
"hardbreak",
|
|
7776
|
-
"softbreak"
|
|
7779
|
+
"softbreak",
|
|
7780
|
+
"comment"
|
|
7777
7781
|
]
|
|
7778
7782
|
};
|
|
7779
7783
|
var link = {
|
|
@@ -7810,6 +7814,11 @@ var softbreak = {
|
|
|
7810
7814
|
return " ";
|
|
7811
7815
|
}
|
|
7812
7816
|
};
|
|
7817
|
+
var comment = {
|
|
7818
|
+
attributes: {
|
|
7819
|
+
content: { type: String, required: true }
|
|
7820
|
+
}
|
|
7821
|
+
};
|
|
7813
7822
|
var error = {};
|
|
7814
7823
|
var node = {};
|
|
7815
7824
|
|
|
@@ -8121,6 +8130,45 @@ function plugin2(md) {
|
|
|
8121
8130
|
md.block.ruler.before("hr", "frontmatter", block2);
|
|
8122
8131
|
}
|
|
8123
8132
|
|
|
8133
|
+
// src/tokenizer/plugins/comments.ts
|
|
8134
|
+
var OPEN2 = "<!--";
|
|
8135
|
+
var CLOSE2 = "-->";
|
|
8136
|
+
function block3(state, startLine, endLine, silent) {
|
|
8137
|
+
const start = state.bMarks[startLine] + state.tShift[startLine];
|
|
8138
|
+
if (!state.src.startsWith(OPEN2, start))
|
|
8139
|
+
return false;
|
|
8140
|
+
const close = state.src.indexOf(CLOSE2, start);
|
|
8141
|
+
if (!close)
|
|
8142
|
+
return false;
|
|
8143
|
+
if (silent)
|
|
8144
|
+
return true;
|
|
8145
|
+
const content = state.src.slice(start + OPEN2.length, close);
|
|
8146
|
+
const lines = content.split("\n").length;
|
|
8147
|
+
const token = state.push("comment", "", 0);
|
|
8148
|
+
token.content = content.trim();
|
|
8149
|
+
token.map = [startLine, startLine + lines];
|
|
8150
|
+
state.line += lines;
|
|
8151
|
+
return true;
|
|
8152
|
+
}
|
|
8153
|
+
function inline3(state, silent) {
|
|
8154
|
+
if (!state.src.startsWith(OPEN2, state.pos))
|
|
8155
|
+
return false;
|
|
8156
|
+
const close = state.src.indexOf(CLOSE2, state.pos);
|
|
8157
|
+
if (!close)
|
|
8158
|
+
return false;
|
|
8159
|
+
if (silent)
|
|
8160
|
+
return true;
|
|
8161
|
+
const content = state.src.slice(state.pos + OPEN2.length, close);
|
|
8162
|
+
const token = state.push("comment", "", 0);
|
|
8163
|
+
token.content = content.trim();
|
|
8164
|
+
state.pos = close + CLOSE2.length;
|
|
8165
|
+
return true;
|
|
8166
|
+
}
|
|
8167
|
+
function plugin3(md) {
|
|
8168
|
+
md.block.ruler.before("table", "comment", block3, { alt: ["paragraph"] });
|
|
8169
|
+
md.inline.ruler.push("comment", inline3);
|
|
8170
|
+
}
|
|
8171
|
+
|
|
8124
8172
|
// src/tokenizer/index.ts
|
|
8125
8173
|
var Tokenizer = class {
|
|
8126
8174
|
constructor(config = {}) {
|
|
@@ -8131,6 +8179,8 @@ var Tokenizer = class {
|
|
|
8131
8179
|
"lheading",
|
|
8132
8180
|
"code"
|
|
8133
8181
|
]);
|
|
8182
|
+
if (config.allowComments)
|
|
8183
|
+
this.parser.use(plugin3, "comments", {});
|
|
8134
8184
|
}
|
|
8135
8185
|
tokenize(content) {
|
|
8136
8186
|
return this.parser.parse(content.toString(), {});
|
|
@@ -8222,7 +8272,7 @@ function validateFunction(fn, config) {
|
|
|
8222
8272
|
});
|
|
8223
8273
|
return errors;
|
|
8224
8274
|
}
|
|
8225
|
-
function
|
|
8275
|
+
function validator(node2, config) {
|
|
8226
8276
|
const schema = node2.findSchema(config);
|
|
8227
8277
|
const errors = [...node2.errors || []];
|
|
8228
8278
|
if (!schema) {
|
|
@@ -8243,8 +8293,6 @@ function validate(node2, config) {
|
|
|
8243
8293
|
...globalAttributes,
|
|
8244
8294
|
...schema.attributes
|
|
8245
8295
|
};
|
|
8246
|
-
if (schema.validate)
|
|
8247
|
-
errors.push(...schema.validate(node2, config));
|
|
8248
8296
|
for (let [key, value] of Object.entries(node2.attributes)) {
|
|
8249
8297
|
const attrib = attributes[key];
|
|
8250
8298
|
if (!attrib) {
|
|
@@ -8329,6 +8377,13 @@ function validate(node2, config) {
|
|
|
8329
8377
|
message: `Can't nest '${type}' in '${node2.tag || node2.type}'`
|
|
8330
8378
|
});
|
|
8331
8379
|
}
|
|
8380
|
+
if (schema.validate) {
|
|
8381
|
+
const schemaErrors = schema.validate(node2, config);
|
|
8382
|
+
if (isPromise(schemaErrors)) {
|
|
8383
|
+
return schemaErrors.then((e) => errors.concat(e));
|
|
8384
|
+
}
|
|
8385
|
+
errors.push(...schemaErrors);
|
|
8386
|
+
}
|
|
8332
8387
|
return errors;
|
|
8333
8388
|
}
|
|
8334
8389
|
|
|
@@ -8368,16 +8423,20 @@ function transform2(nodes, options) {
|
|
|
8368
8423
|
return content.flatMap((child) => child.transform(config));
|
|
8369
8424
|
return content.transform(config);
|
|
8370
8425
|
}
|
|
8371
|
-
function
|
|
8426
|
+
function validate(content, options) {
|
|
8372
8427
|
const config = mergeConfig(options);
|
|
8373
|
-
const output = []
|
|
8374
|
-
for (const node2 of [content, ...content.walk()]) {
|
|
8428
|
+
const output = [content, ...content.walk()].map((node2) => {
|
|
8375
8429
|
const { type, lines, location } = node2;
|
|
8376
|
-
const errors =
|
|
8377
|
-
|
|
8378
|
-
|
|
8430
|
+
const errors = validator(node2, config);
|
|
8431
|
+
if (isPromise(errors)) {
|
|
8432
|
+
return errors.then((e) => e.map((error2) => ({ type, lines, location, error: error2 })));
|
|
8433
|
+
}
|
|
8434
|
+
return errors.map((error2) => ({ type, lines, location, error: error2 }));
|
|
8435
|
+
});
|
|
8436
|
+
if (output.some(isPromise)) {
|
|
8437
|
+
return Promise.all(output).then((o) => o.flat());
|
|
8379
8438
|
}
|
|
8380
|
-
return output;
|
|
8439
|
+
return output.flat();
|
|
8381
8440
|
}
|
|
8382
8441
|
function createElement(name, attributes = {}, ...children) {
|
|
8383
8442
|
return { name, attributes, children };
|
|
@@ -8387,7 +8446,7 @@ var Markdoc = class {
|
|
|
8387
8446
|
this.parse = parse3;
|
|
8388
8447
|
this.resolve = (content) => resolve2(content, this.config);
|
|
8389
8448
|
this.transform = (content) => transform2(content, this.config);
|
|
8390
|
-
this.validate = (content) =>
|
|
8449
|
+
this.validate = (content) => validate(content, this.config);
|
|
8391
8450
|
this.config = config;
|
|
8392
8451
|
}
|
|
8393
8452
|
};
|
|
@@ -8402,10 +8461,10 @@ Markdoc.Tag = Tag;
|
|
|
8402
8461
|
Markdoc.Tokenizer = Tokenizer;
|
|
8403
8462
|
Markdoc.parseTags = parseTags;
|
|
8404
8463
|
Markdoc.transformer = transformer_default;
|
|
8405
|
-
Markdoc.validator =
|
|
8464
|
+
Markdoc.validator = validator;
|
|
8406
8465
|
Markdoc.parse = parse3;
|
|
8407
8466
|
Markdoc.transform = transform2;
|
|
8408
|
-
Markdoc.validate =
|
|
8467
|
+
Markdoc.validate = validate;
|
|
8409
8468
|
Markdoc.createElement = createElement;
|
|
8410
8469
|
Markdoc.truthy = truthy;
|
|
8411
8470
|
Markdoc.__EXPERIMENTAL__format = format;
|