PK 1s}X remark-subheading-2.0.0/PK 1s}X remark-subheading-2.0.0/lib/PK 1s}Xóï1aÅ Å 0 remark-subheading-2.0.0/lib/remark-subheading.js// These `unist-util-*` utilities are super useful when work with // unified-compatible syntax trees const is = require("unist-util-is"); const visit = require("unist-util-visit"); // We're going to need this to convert some mdast nodes to hast nodes later on const mdastToHast = require("mdast-util-to-hast"); // Our plugin's constructor function. This would receive configuration options. function subtitlePlugin() { // Plugins need to return a transform function that takes a unified compatable // AST and manipulate or walk it. return async function transform(tree) { // Go through the markdown document (in mdast form) and call my callback // whenever you see paragraph nodes. visit(tree, "paragraph", (paragraphNode) => { const { children } = paragraphNode; // Get the first child node under the paragraph and make sure it's a text // node. If it's not, skip processing this paragraph node. const textNode = children && children[0]; if (!is(textNode, "text")) { return; } // Does this text node start with a sequence of hash ('#') signs followed // by a dash ('-')? const text = typeof textNode.value === "string" ? textNode.value.trimLeft() : ""; const re = /^(#{1,6})-\s+/; const matches = text.match(re); if (typeof text === "string" && !matches) { return; } // If it did let's count the number of '#'s as that will be our subtitle // depth const depth = matches[1].length; // Once we have what we need, let's make a copy of this text node without // the leading subtitle syntax. // i.e. '##- hello world' becomes 'hello world' const newValue = text.replace(re, ""); // We can now attach some metadata to an mdast node. If the node is being // serialized to html by a hast-compatible library, it will know to use // these overrides instead of the default behaviour of rendering a plain //
tag. paragraphNode.data = { // we could use a different html tag but "p" is semantically correct for // the subtitle hName: "p", // The
tag will have the following attributes added to it. // Note that we need to use "className" for the html "class" attribute. hProperties: { className: `subtitle subtitle--${depth}`, "data-remark-subtype": "subtitle", "data-subtitle": depth, }, // When we are passing custom children, it is our responsibility to make // sure they are in hast format instead of mdast. We use the library, // mdast-util-to-hast, to do this conversion. hChildren: [ // We pass in a modified text node without the leading subtitle // characters { ...textNode, value: newValue, }, // Then we pass in the rest of the children under this paragraph node ...children.slice(1), ].map(mdastToHast), // Finally convert it all to hast }; }); }; }; // === Our pipeline === // A markdown parser that spits out mdast const remark = require("remark"); // An mdast to html serializer const html = require("remark-html"); const text = ` # Hello ###- How are __you__? Great!`; remark() .use(subtitlePlugin) // the plugin we'll write .use(html) .process(text /* markdown in */, function (err, file) { if (err) throw err; console.log(String(file)); /* html out */ });; PK 5s}X-d¢„ „ $ remark-subheading-2.0.0/package.json{ "name": "@runkit/disintegrator_remark-subheading", "version": "2.0.0", "main": "./lib/remark-subheading", "dependencies": { "unist-util-is": "4.0.2", "unist-util-visit": "2.0.3", "mdast-util-to-hast": "9.1.0", "remark": "12.0.1", "remark-html": "12.0.0" }, "scripts": { "install": "node scripts/install.js" } }PK 5s}X*uR›b® b® + remark-subheading-2.0.0/npm-shrinkwrap.json{ "name": "@runkit/disintegrator_remark-subheading", "version": "2.0.0", "dependencies": { "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } }, "mdast-util-to-hast": { "version": "9.1.0", "from": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-9.1.0.tgz", "dependencies": { "@types/mdast": { "version": "3.0.3", "from": "https://registry.npmjs.org/@types/mdast/-/types/mdast-3.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" } } }, "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "collapse-white-space": { "version": "1.0.6", "from": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz" }, "detab": { "version": "2.0.3", "from": "https://registry.npmjs.org/detab/-/detab-2.0.3.tgz", "dependencies": { "repeat-string": { "version": "1.6.1", "from": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" } } }, "mdast-util-definitions": { "version": "3.0.1", "from": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-3.0.1.tgz", "dependencies": { "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } } } }, "mdurl": { "version": "1.0.1", "from": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" }, "trim-lines": { "version": "1.1.3", "from": "https://registry.npmjs.org/trim-lines/-/trim-lines-1.1.3.tgz" }, "unist-builder": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz" }, "unist-util-generated": { "version": "1.1.5", "from": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.5.tgz" }, "unist-util-position": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz" }, "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } } } }, "remark": { "version": "12.0.1", "from": "https://registry.npmjs.org/remark/-/remark-12.0.1.tgz", "dependencies": { "remark-parse": { "version": "8.0.3", "from": "https://registry.npmjs.org/remark-parse/-/remark-parse-8.0.3.tgz", "dependencies": { "ccount": { "version": "1.0.5", "from": "https://registry.npmjs.org/ccount/-/ccount-1.0.5.tgz" }, "collapse-white-space": { "version": "1.0.6", "from": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz" }, "is-alphabetical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz" }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" }, "is-whitespace-character": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz" }, "is-word-character": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-word-character/-/is-word-character-1.0.4.tgz" }, "markdown-escapes": { "version": "1.0.4", "from": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz" }, "parse-entities": { "version": "2.0.0", "from": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", "dependencies": { "character-entities": { "version": "1.2.4", "from": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz" }, "character-entities-legacy": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz" }, "character-reference-invalid": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz" }, "is-alphanumerical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "dependencies": { "is-alphabetical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz" }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" } } }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" }, "is-hexadecimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz" } } }, "repeat-string": { "version": "1.6.1", "from": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, "state-toggle": { "version": "1.0.3", "from": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz" }, "trim": { "version": "0.0.1", "from": "https://registry.npmjs.org/trim/-/trim-0.0.1.tgz" }, "trim-trailing-lines": { "version": "1.1.3", "from": "https://registry.npmjs.org/trim-trailing-lines/-/trim-trailing-lines-1.1.3.tgz" }, "unherit": { "version": "1.1.3", "from": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", "dependencies": { "inherits": { "version": "2.0.4", "from": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" }, "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "unist-util-remove-position": { "version": "2.0.1", "from": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-2.0.1.tgz", "dependencies": { "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } } } }, "vfile-location": { "version": "3.0.1", "from": "https://registry.npmjs.org/vfile-location/-/vfile-location-3.0.1.tgz" }, "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "remark-stringify": { "version": "8.1.1", "from": "https://registry.npmjs.org/remark-stringify/-/remark-stringify-8.1.1.tgz", "dependencies": { "ccount": { "version": "1.0.5", "from": "https://registry.npmjs.org/ccount/-/ccount-1.0.5.tgz" }, "is-alphanumeric": { "version": "1.0.0", "from": "https://registry.npmjs.org/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz" }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" }, "is-whitespace-character": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-whitespace-character/-/is-whitespace-character-1.0.4.tgz" }, "longest-streak": { "version": "2.0.4", "from": "https://registry.npmjs.org/longest-streak/-/longest-streak-2.0.4.tgz" }, "markdown-escapes": { "version": "1.0.4", "from": "https://registry.npmjs.org/markdown-escapes/-/markdown-escapes-1.0.4.tgz" }, "markdown-table": { "version": "2.0.0", "from": "https://registry.npmjs.org/markdown-table/-/markdown-table-2.0.0.tgz", "dependencies": { "repeat-string": { "version": "1.6.1", "from": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" } } }, "mdast-util-compact": { "version": "2.0.1", "from": "https://registry.npmjs.org/mdast-util-compact/-/mdast-util-compact-2.0.1.tgz", "dependencies": { "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } } } }, "parse-entities": { "version": "2.0.0", "from": "https://registry.npmjs.org/parse-entities/-/parse-entities-2.0.0.tgz", "dependencies": { "character-entities": { "version": "1.2.4", "from": "https://registry.npmjs.org/character-entities/-/character-entities-1.2.4.tgz" }, "character-entities-legacy": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz" }, "character-reference-invalid": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz" }, "is-alphanumerical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "dependencies": { "is-alphabetical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz" }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" } } }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" }, "is-hexadecimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz" } } }, "repeat-string": { "version": "1.6.1", "from": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" }, "state-toggle": { "version": "1.0.3", "from": "https://registry.npmjs.org/state-toggle/-/state-toggle-1.0.3.tgz" }, "stringify-entities": { "version": "3.0.1", "from": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.1.tgz", "dependencies": { "character-entities-html4": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz" }, "character-entities-legacy": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz" }, "is-alphanumerical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "dependencies": { "is-alphabetical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz" }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" } } }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" }, "is-hexadecimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz" } } }, "unherit": { "version": "1.1.3", "from": "https://registry.npmjs.org/unherit/-/unherit-1.1.3.tgz", "dependencies": { "inherits": { "version": "2.0.4", "from": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz" }, "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "unified": { "version": "9.1.0", "from": "https://registry.npmjs.org/unified/-/unified-9.1.0.tgz", "dependencies": { "bail": { "version": "1.0.5", "from": "https://registry.npmjs.org/bail/-/bail-1.0.5.tgz" }, "extend": { "version": "3.0.2", "from": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz" }, "is-buffer": { "version": "2.0.4", "from": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz" }, "is-plain-obj": { "version": "2.1.0", "from": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz" }, "trough": { "version": "1.0.5", "from": "https://registry.npmjs.org/trough/-/trough-1.0.5.tgz" }, "vfile": { "version": "4.2.0", "from": "https://registry.npmjs.org/vfile/-/vfile-4.2.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "is-buffer": { "version": "2.0.4", "from": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz" }, "replace-ext": { "version": "1.0.0", "from": "https://registry.npmjs.org/replace-ext/-/replace-ext-1.0.0.tgz" }, "unist-util-stringify-position": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" } } }, "vfile-message": { "version": "2.0.4", "from": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-stringify-position": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" } } } } } } } } } } }, "remark-html": { "version": "12.0.0", "from": "https://registry.npmjs.org/remark-html/-/remark-html-12.0.0.tgz", "dependencies": { "hast-util-sanitize": { "version": "3.0.0", "from": "https://registry.npmjs.org/hast-util-sanitize/-/hast-util-sanitize-3.0.0.tgz", "dependencies": { "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "hast-util-to-html": { "version": "7.1.1", "from": "https://registry.npmjs.org/hast-util-to-html/-/hast-util-to-html-7.1.1.tgz", "dependencies": { "ccount": { "version": "1.0.5", "from": "https://registry.npmjs.org/ccount/-/ccount-1.0.5.tgz" }, "comma-separated-tokens": { "version": "1.0.8", "from": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.8.tgz" }, "hast-util-is-element": { "version": "1.0.4", "from": "https://registry.npmjs.org/hast-util-is-element/-/hast-util-is-element-1.0.4.tgz" }, "hast-util-whitespace": { "version": "1.0.4", "from": "https://registry.npmjs.org/hast-util-whitespace/-/hast-util-whitespace-1.0.4.tgz" }, "html-void-elements": { "version": "1.0.5", "from": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.5.tgz" }, "property-information": { "version": "5.5.0", "from": "https://registry.npmjs.org/property-information/-/property-information-5.5.0.tgz", "dependencies": { "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "space-separated-tokens": { "version": "1.1.5", "from": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.5.tgz" }, "stringify-entities": { "version": "3.0.1", "from": "https://registry.npmjs.org/stringify-entities/-/stringify-entities-3.0.1.tgz", "dependencies": { "character-entities-html4": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-entities-html4/-/character-entities-html4-1.1.4.tgz" }, "character-entities-legacy": { "version": "1.1.4", "from": "https://registry.npmjs.org/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz" }, "is-alphanumerical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz", "dependencies": { "is-alphabetical": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-alphabetical/-/is-alphabetical-1.0.4.tgz" }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" } } }, "is-decimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-decimal/-/is-decimal-1.0.4.tgz" }, "is-hexadecimal": { "version": "1.0.4", "from": "https://registry.npmjs.org/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz" } } }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } }, "mdast-util-to-hast": { "version": "9.1.0", "from": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-9.1.0.tgz", "dependencies": { "@types/mdast": { "version": "3.0.3", "from": "https://registry.npmjs.org/@types/mdast/-/types/mdast-3.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" } } }, "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "collapse-white-space": { "version": "1.0.6", "from": "https://registry.npmjs.org/collapse-white-space/-/collapse-white-space-1.0.6.tgz" }, "detab": { "version": "2.0.3", "from": "https://registry.npmjs.org/detab/-/detab-2.0.3.tgz", "dependencies": { "repeat-string": { "version": "1.6.1", "from": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz" } } }, "mdast-util-definitions": { "version": "3.0.1", "from": "https://registry.npmjs.org/mdast-util-definitions/-/mdast-util-definitions-3.0.1.tgz", "dependencies": { "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } } } }, "mdurl": { "version": "1.0.1", "from": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz" }, "trim-lines": { "version": "1.1.3", "from": "https://registry.npmjs.org/trim-lines/-/trim-lines-1.1.3.tgz" }, "unist-builder": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-builder/-/unist-builder-2.0.3.tgz" }, "unist-util-generated": { "version": "1.1.5", "from": "https://registry.npmjs.org/unist-util-generated/-/unist-util-generated-1.1.5.tgz" }, "unist-util-position": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-position/-/unist-util-position-3.1.0.tgz" }, "unist-util-visit": { "version": "2.0.3", "from": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" }, "unist-util-visit-parents": { "version": "3.1.0", "from": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.0.tgz", "dependencies": { "@types/unist": { "version": "2.0.3", "from": "https://registry.npmjs.org/@types/unist/-/types/unist-2.0.3.tgz" }, "unist-util-is": { "version": "4.0.2", "from": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.0.2.tgz" } } } } } } }, "xtend": { "version": "4.0.2", "from": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz" } } } } }PK 5s}X remark-subheading-2.0.0/scripts/PK 5s}X çšCZ Z * remark-subheading-2.0.0/scripts/install.jsvar fs = require('fs'); var path = require('path'); var json = require("../package.json"); var match = json.name.match(/^@runkit\/(.*)_(.*)$/); // check if our module name actually makes sense, otherwise abort if (!match) throw new Error("Unknown package structure!"); // check if we're actually inside a node_modules/@runkit folder, otherwise don't create symlinks if (path.basename(path.dirname(process.cwd())) !== "@runkit" || path.basename(path.dirname(path.dirname(process.cwd()))) !== "node_modules") { console.log("Not installing as notebook: " + process.cwd()); return; } console.log("creating notebook symlinks"); var userPath = path.join("..", match[1]); var repoPath = path.join(userPath, match[2]); mkdir(userPath); mkdir(repoPath); var branchMatch = json.version.match(/^0\.0\.0\-(.*)$/); if (branchMatch) { var branchPath = path.join(repoPath, "branches"); mkdir(branchPath); var versionPath = path.join(branchPath, branchMatch[1]); var relativePath = path.join("..", "..", "..", path.basename(process.cwd())); unlink(versionPath); fs.symlinkSync(relativePath, versionPath); } else { var relativePath = path.join("..", "..", path.basename(process.cwd())); var latestPath = path.join(repoPath, "latest"); var versionPath = path.join(repoPath, json.version); unlink(latestPath); fs.symlinkSync(relativePath, latestPath); unlink(versionPath); fs.symlinkSync(relativePath, versionPath); } function mkdir(p) { try { fs.mkdirSync(p); } catch (e) {} } function unlink(p) { try { fs.unlinkSync(p); } catch (e) {} }PK 1s}X remark-subheading-2.0.0/PK 1s}X 6 remark-subheading-2.0.0/lib/PK 1s}Xóï1aÅ Å 0 p remark-subheading-2.0.0/lib/remark-subheading.jsPK 5s}X-d¢„ „ $ ƒ remark-subheading-2.0.0/package.jsonPK 5s}X*uR›b® b® + I remark-subheading-2.0.0/npm-shrinkwrap.jsonPK 5s}X ô¾ remark-subheading-2.0.0/scripts/PK 5s}X çšCZ Z * 2¿ remark-subheading-2.0.0/scripts/install.jsPK ? ÔÅ