Comparing version 0.0.3 to 0.0.4
@@ -9,2 +9,4 @@ "use strict"; | ||
const remark_parse_1 = __importDefault(require("remark-parse")); | ||
const remark_frontmatter_1 = __importDefault(require("remark-frontmatter")); | ||
const remark_gfm_1 = __importDefault(require("remark-gfm")); | ||
const vfile_1 = __importDefault(require("vfile")); | ||
@@ -19,2 +21,4 @@ const path_1 = __importDefault(require("path")); | ||
const codeblock_1 = require("./plugins/codeblock"); | ||
const frontmatter_1 = require("./plugins/frontmatter"); | ||
const split_1 = require("./plugins/split"); | ||
const io_1 = require("../io"); | ||
@@ -32,2 +36,3 @@ const log = debug_1.default("markdown"); | ||
.data("dependencies", dependencies) | ||
.use(frontmatter_1.removeFrontMatter) | ||
.use(codeblock_1.importCodeBlock, { io: options.io }) | ||
@@ -37,2 +42,3 @@ .use(remark_rehype_1.default, { handlers: codeblock_1.mdastToHastCodeBlockHandlers }) | ||
.use(codeblock_1.generateCodeBlockFragment) | ||
.use(split_1.split) | ||
.run(tree, src, (err, transformedTree) => { | ||
@@ -91,3 +97,7 @@ if (err) { | ||
else { | ||
tree = unified_1.default().use(remark_parse_1.default, { gfm: true }).parse(src); | ||
tree = unified_1.default() | ||
.use(remark_parse_1.default) | ||
.use(remark_gfm_1.default) | ||
.use(remark_frontmatter_1.default, ["yaml", "toml"]) | ||
.parse(src); | ||
cache.set(cacheKey, fast_copy_1.default(tree), src.path); | ||
@@ -94,0 +104,0 @@ } |
@@ -32,2 +32,3 @@ "use strict"; | ||
}; | ||
// Generate code block fragment | ||
exports.generateCodeBlockFragment = function () { | ||
@@ -70,2 +71,3 @@ const codeblocks = this.data("codeblocks"); | ||
}; | ||
// Import code block from file and insert file content into tree | ||
exports.importCodeBlock = function (options) { | ||
@@ -72,0 +74,0 @@ const codeblocks = this.data("codeblocks"); |
{ | ||
"name": "mtdoc", | ||
"version": "0.0.3", | ||
"version": "0.0.4", | ||
"license": "MIT", | ||
@@ -17,3 +17,3 @@ "files": [ | ||
"demo:build": "env DEBUG_COLORS=1 ts-node src/bin/mtdoc.ts", | ||
"prepublish": "yarn build" | ||
"prepublishOnly": "yarn build" | ||
}, | ||
@@ -31,8 +31,10 @@ "dependencies": { | ||
"nanoid": "^3.1.12", | ||
"remark-frontmatter": "^2.0.0", | ||
"remark-parse": "^8.0.3", | ||
"remark-rehype": "^7.0.0", | ||
"remark-frontmatter": "^3.0.0", | ||
"remark-gfm": "^1.0.0", | ||
"remark-parse": "^9.0.0", | ||
"remark-rehype": "^8.0.0", | ||
"unified": "^9.1.0", | ||
"unist-builder": "^2.0.3", | ||
"unist-util-is": "^4.0.2", | ||
"unist-util-remove": "^2.0.0", | ||
"unist-util-visit": "^2.0.3", | ||
@@ -39,0 +41,0 @@ "vfile": "^4.2.0", |
65658
56
1735
21
+ Addedremark-gfm@^1.0.0
+ Addedunist-util-remove@^2.0.0
+ Addedescape-string-regexp@4.0.0(transitive)
+ Addedlongest-streak@2.0.4(transitive)
+ Addedmarkdown-table@2.0.0(transitive)
+ Addedmdast-util-definitions@4.0.0(transitive)
+ Addedmdast-util-find-and-replace@1.1.1(transitive)
+ Addedmdast-util-from-markdown@0.8.5(transitive)
+ Addedmdast-util-frontmatter@0.2.0(transitive)
+ Addedmdast-util-gfm@0.1.2(transitive)
+ Addedmdast-util-gfm-autolink-literal@0.1.3(transitive)
+ Addedmdast-util-gfm-strikethrough@0.2.3(transitive)
+ Addedmdast-util-gfm-table@0.1.6(transitive)
+ Addedmdast-util-gfm-task-list-item@0.1.6(transitive)
+ Addedmdast-util-to-hast@10.2.0(transitive)
+ Addedmdast-util-to-markdown@0.6.5(transitive)
+ Addedmdast-util-to-string@2.0.0(transitive)
+ Addedmicromark@2.11.4(transitive)
+ Addedmicromark-extension-frontmatter@0.2.2(transitive)
+ Addedmicromark-extension-gfm@0.3.3(transitive)
+ Addedmicromark-extension-gfm-autolink-literal@0.5.7(transitive)
+ Addedmicromark-extension-gfm-strikethrough@0.6.5(transitive)
+ Addedmicromark-extension-gfm-table@0.4.3(transitive)
+ Addedmicromark-extension-gfm-tagfilter@0.3.0(transitive)
+ Addedmicromark-extension-gfm-task-list-item@0.3.3(transitive)
+ Addedremark-frontmatter@3.0.0(transitive)
+ Addedremark-gfm@1.0.0(transitive)
+ Addedremark-parse@9.0.0(transitive)
+ Addedremark-rehype@8.1.0(transitive)
+ Addedunist-util-remove@2.1.0(transitive)
+ Addedzwitch@1.0.5(transitive)
- Removedcollapse-white-space@1.0.6(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-whitespace-character@1.0.4(transitive)
- Removedis-word-character@1.0.4(transitive)
- Removedmarkdown-escapes@1.0.4(transitive)
- Removedmdast-util-definitions@3.0.1(transitive)
- Removedmdast-util-to-hast@9.1.2(transitive)
- Removedremark-frontmatter@2.0.0(transitive)
- Removedremark-parse@8.0.3(transitive)
- Removedremark-rehype@7.0.0(transitive)
- Removedstate-toggle@1.0.3(transitive)
- Removedtrim@0.0.1(transitive)
- Removedtrim-trailing-lines@1.1.4(transitive)
- Removedunherit@1.1.3(transitive)
- Removedunist-util-remove-position@2.0.1(transitive)
- Removedvfile-location@3.2.0(transitive)
Updatedremark-frontmatter@^3.0.0
Updatedremark-parse@^9.0.0
Updatedremark-rehype@^8.0.0