feat(v2): support rightToc, emoji, slug for docs (#1382)

* add remark-slug and remark-emoji

* implement right TOC remark plugin

* use rehype-slug ecosystem instead of remark for perf

* first rough implementation for right toc

* nits

* remove unwanted changes

* fix left border styling

* remove depths

* inline snapshot
This commit is contained in:
Endilie Yacop Sucipto 2019-04-23 15:22:11 +07:00 committed by GitHub
parent 37897ffc96
commit 745f32b010
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 570 additions and 53 deletions

View file

@ -8,11 +8,25 @@
},
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.4.3",
"@babel/traverse": "^7.4.3",
"@mapbox/rehype-prism": "^0.3.1",
"@mdx-js/mdx": "^1.0.0-rc.0",
"@mdx-js/react": "^1.0.0-rc.0",
"@mdx-js/mdx": "^1.0.14",
"@mdx-js/react": "^1.0.6",
"github-slugger": "^1.2.1",
"loader-utils": "^1.2.3",
"mdast-util-to-string": "^1.0.5",
"prism-themes": "^1.1.0",
"prismjs": "^1.16.0"
"prismjs": "^1.16.0",
"rehype-slug": "^2.0.2",
"remark-emoji": "^2.0.2",
"stringify-object": "^3.3.0",
"unist-util-visit": "^1.4.0"
},
"devDependencies": {
"@babel/polyfill": "^7.4.3",
"remark": "^10.0.1",
"remark-mdx": "^1.0.14",
"to-vfile": "^5.0.2"
}
}

View file

@ -7,9 +7,13 @@
const {getOptions} = require('loader-utils');
const mdx = require('@mdx-js/mdx');
const rehypePrism = require('@mapbox/rehype-prism');
const emoji = require('remark-emoji');
const slug = require('rehype-slug');
const rightToc = require('./rightToc');
const DEFAULT_OPTIONS = {
rehypePlugins: [[rehypePrism, {ignoreMissing: true}]],
rehypePlugins: [slug, [(rehypePrism, {ignoreMissing: true})]],
remarkPlugins: [emoji, rightToc],
prismTheme: 'prism-themes/themes/prism-atom-dark.css',
};

View file

@ -0,0 +1,5 @@
# Ignore this
##
## ![](an-image.svg)

View file

@ -0,0 +1,11 @@
import something from 'something';
import somethingElse from 'something-else';
## Title
## Test
### Again
Content.

View file

@ -0,0 +1,15 @@
### Endi
```md
## This is ignored
```
## Endi
Lorem ipsum
### Yangshun
Some content here
## I ♥ unicode.

View file

@ -0,0 +1,7 @@
export const rightToc = ['replaceMe'];
## Thanos
## Tony Stark
### Avengers

View file

@ -0,0 +1,200 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
import '@babel/polyfill';
import {join} from 'path';
import remark from 'remark';
import mdx from 'remark-mdx';
import vfile from 'to-vfile';
import plugin from '../index';
const processFixture = async (name, options) => {
const path = join(__dirname, 'fixtures', `${name}.mdx`);
const file = await vfile.read(path);
const result = await remark()
.use(mdx)
.use(plugin, options)
.process(file);
return result.toString();
};
test('no options', async () => {
const result = await processFixture('just-content');
expect(result).toMatchInlineSnapshot(`
"export const rightToc = [
{
value: 'Endi',
id: 'endi',
children: []
},
{
value: 'Endi',
id: 'endi-1',
children: [
{
value: 'Yangshun',
id: 'yangshun',
children: []
}
]
},
{
value: 'I ♥ unicode.',
id: 'i--unicode',
children: []
}
];
### Endi
\`\`\`md
## This is ignored
\`\`\`
## Endi
Lorem ipsum
### Yangshun
Some content here
## I unicode.
"
`);
});
test('should export even with existing name', async () => {
const result = await processFixture('name-exist');
expect(result).toMatchInlineSnapshot(`
"export const rightToc = [
{
value: 'Thanos',
id: 'thanos',
children: []
},
{
value: 'Tony Stark',
id: 'tony-stark',
children: [
{
value: 'Avengers',
id: 'avengers',
children: []
}
]
}
];
## Thanos
## Tony Stark
### Avengers
"
`);
});
test('should export with custom name', async () => {
const options = {
name: 'customName',
};
const result = await processFixture('just-content', options);
expect(result).toMatchInlineSnapshot(`
"export const customName = [
{
value: 'Endi',
id: 'endi',
children: []
},
{
value: 'Endi',
id: 'endi-1',
children: [
{
value: 'Yangshun',
id: 'yangshun',
children: []
}
]
},
{
value: 'I ♥ unicode.',
id: 'i--unicode',
children: []
}
];
### Endi
\`\`\`md
## This is ignored
\`\`\`
## Endi
Lorem ipsum
### Yangshun
Some content here
## I unicode.
"
`);
});
test('should insert below imports', async () => {
const result = await processFixture('insert-below-imports');
expect(result).toMatchInlineSnapshot(`
"import something from 'something';
import somethingElse from 'something-else';
export const rightToc = [
{
value: 'Title',
id: 'title',
children: []
},
{
value: 'Test',
id: 'test',
children: [
{
value: 'Again',
id: 'again',
children: []
}
]
}
];
## Title
## Test
### Again
Content.
"
`);
});
test('empty headings', async () => {
const result = await processFixture('empty-headings');
expect(result).toMatchInlineSnapshot(`
"export const rightToc = [];
# Ignore this
##
## ![](an-image.svg)
"
`);
});

View file

@ -0,0 +1,78 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const {parse} = require('@babel/parser');
const traverse = require('@babel/traverse').default;
const stringifyObject = require('stringify-object');
const search = require('./search');
const parseOptions = {
plugins: ['jsx'],
sourceType: 'module',
};
const isImport = child => child.type === 'import';
const hasImports = index => index > -1;
const isExport = child => child.type === 'export';
const isTarget = (child, name) => {
let found = false;
const ast = parse(child.value, parseOptions);
traverse(ast, {
VariableDeclarator: path => {
if (path.node.id.name === name) {
found = true;
}
},
});
return found;
};
const getOrCreateExistingTargetIndex = (children, name) => {
let importsIndex = -1;
let targetIndex = -1;
children.forEach((child, index) => {
if (isImport(child)) {
importsIndex = index;
} else if (isExport(child) && isTarget(child, name)) {
targetIndex = index;
}
});
if (targetIndex === -1) {
const target = {
default: false,
type: 'export',
value: `export const ${name} = [];`,
};
targetIndex = hasImports(importsIndex) ? importsIndex + 1 : 0;
children.splice(targetIndex, 0, target);
}
return targetIndex;
};
const plugin = (options = {}) => {
const name = options.name || 'rightToc';
const transformer = node => {
const headings = search(node);
const {children} = node;
const targetIndex = getOrCreateExistingTargetIndex(children, name);
if (headings && headings.length) {
children[targetIndex].value = `export const ${name} = ${stringifyObject(
headings,
)};`;
}
};
return transformer;
};
module.exports = plugin;

View file

@ -0,0 +1,46 @@
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const toString = require('mdast-util-to-string');
const visit = require('unist-util-visit');
const slugs = require('github-slugger')();
// Visit all headings. We `slug` all headings (to account for
// duplicates), but only take h2 and h3 headings.
const search = node => {
const headings = [];
let current = -1;
let currentDepth = 0;
slugs.reset();
const onHeading = (child, index, parent) => {
const value = toString(child);
const id =
child.data && child.data.hProperties && child.data.hProperties.id;
const slug = slugs.slug(id || value);
if (parent !== node || !value || child.depth > 3 || child.depth < 2) {
return;
}
const entry = {value, id: slug, children: []};
if (!headings.length || currentDepth >= child.depth) {
headings.push(entry);
current += 1;
currentDepth = child.depth;
} else {
headings[current].children.push(entry);
}
};
visit(node, 'heading', onHeading);
return headings;
};
module.exports = search;

View file

@ -66,6 +66,15 @@ function ComponentCreator(path) {
val = val[keyPath[i]];
}
val[keyPath[keyPath.length - 1]] = loaded[key].default;
const nonDefaultKeys = Object.keys(loaded[key]).filter(
k => k !== 'default',
);
if (nonDefaultKeys && nonDefaultKeys.length) {
nonDefaultKeys.forEach(nonDefaultKey => {
val[keyPath[keyPath.length - 1]][nonDefaultKey] =
loaded[key][nonDefaultKey];
});
}
});
const Component = loadedModules.component;

View file

@ -13,6 +13,22 @@ import Head from '@docusaurus/Head';
import styles from './styles.module.css';
const Headings = ({headings, isChild}) => {
if (!headings.length) return null;
return (
<ul className={isChild ? 'contents' : 'contents contents__left-border'}>
{headings.map(heading => (
<li key={heading.id}>
<a href={`#${heading.id}`} className="contents__link">
{heading.value}
</a>
<Headings isChild headings={heading.children} />
</li>
))}
</ul>
);
};
function DocBody(props) {
const {metadata, content} = props;
const {language, version} = metadata;
@ -42,37 +58,7 @@ function DocBody(props) {
</div>
</div>
<div className="col col--2 col--offset-1">
<ul className="contents contents__left-border">
<li>
<a className="contents__link" href="#url">
Dummy Text
</a>
</li>
<li>
<a className="contents__link" href="#url">
Dummy Text
</a>
<ul>
<li>
<a
className="contents__link contents__link--active"
href="#url">
Dummy Text
</a>
</li>
<li>
<a className="contents__link" href="#url">
Dummy Text
</a>
</li>
</ul>
</li>
<li>
<a className="contents__link" href="#url">
Dummy Text
</a>
</li>
</ul>
{content.rightToc && <Headings headings={content.rightToc} />}
</div>
</div>
</div>

178
yarn.lock
View file

@ -676,6 +676,14 @@
core-js "^2.6.5"
regenerator-runtime "^0.13.2"
"@babel/polyfill@^7.4.3":
version "7.4.3"
resolved "https://registry.yarnpkg.com/@babel/polyfill/-/polyfill-7.4.3.tgz#332dc6f57b718017c3a8b37b4eea8aa6eeac1187"
integrity sha512-rkv8WIvJshA5Ev8iNMGgz5WZkRtgtiPexiT7w5qevGTuT7ZBfM3de9ox1y9JR5/OXb/sWGBbWlHNa7vQKqku3Q==
dependencies:
core-js "^2.6.5"
regenerator-runtime "^0.13.2"
"@babel/preset-env@^7.0.0", "@babel/preset-env@^7.4.2":
version "7.4.2"
resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.4.2.tgz#2f5ba1de2daefa9dcca653848f96c7ce2e406676"
@ -1614,18 +1622,20 @@
refractor "^2.3.0"
unist-util-visit "^1.1.3"
"@mdx-js/mdx@^1.0.0-rc.0":
version "1.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.0.0-rc.0.tgz#c31c8dae9c08e6494018e0fde4a0d87a7364f7a8"
integrity sha512-PpDmC9i1LJKAK/BNce75D8QZS05ccfVMJZKGalogvGw0b8R+vQcMBtlklbVOqk10oVBe1TYYbRdniOkt1ziHMw==
"@mdx-js/mdx@^1.0.14":
version "1.0.14"
resolved "https://registry.yarnpkg.com/@mdx-js/mdx/-/mdx-1.0.14.tgz#f27d51cc0919c2d2be9681fb7689eb8a5a3ea1cd"
integrity sha512-x0V06637Ei3i/ZsagaulupSXPcwmMQC11JzKTTlITszOsLKciDleySbB51Y8WGqEYx1km7WSFacVQcQkj6ONSw==
dependencies:
"@babel/plugin-proposal-object-rest-spread" "^7.3.2"
"@babel/helper-plugin-utils" "^7.0.0"
"@babel/plugin-syntax-jsx" "^7.2.0"
"@babel/plugin-syntax-object-rest-spread" "^7.2.0"
change-case "^3.0.2"
detab "^2.0.0"
hast-util-raw "^5.0.0"
lodash.uniq "^4.5.0"
mdast-util-to-hast "^4.0.0"
remark-mdx "^1.0.0-rc.0"
remark-mdx "^1.0.14"
remark-parse "^6.0.0"
remark-squeeze-paragraphs "^3.0.1"
to-style "^1.3.3"
@ -1633,10 +1643,10 @@
unist-builder "^1.0.1"
unist-util-visit "^1.3.0"
"@mdx-js/react@^1.0.0-rc.0":
version "1.0.0-rc.0"
resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.0.0-rc.0.tgz#1863287fe20a396c13280e155a29dbf9f8a40889"
integrity sha512-yE/eEUDBkdSdsSdXvantAn8Q6CdM+u2Nor2IRaN8Fe+p8IGpMfHqLFS3WSIZpodGB4PYUxRsGINDl7ITSZXQyg==
"@mdx-js/react@^1.0.6":
version "1.0.6"
resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-1.0.6.tgz#59bc131b68cc4f1a246d1e2b79f1223a897e6b65"
integrity sha512-y7Oua/TqZ+2JxRP7Skdno6SPuRnStAgk5LVFLcsowlhu2h6WuUfVI0HvL0KVouCW030v95qDAiLZDVhBiuDSNQ==
"@mrmlnc/readdir-enhanced@^2.2.1":
version "2.2.1"
@ -3161,7 +3171,7 @@ caw@^2.0.0, caw@^2.0.1:
tunnel-agent "^0.6.0"
url-to-options "^1.0.1"
ccount@^1.0.3:
ccount@^1.0.0, ccount@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.0.3.tgz#f1cec43f332e2ea5a569fd46f9f5bde4e6102aff"
integrity sha512-Jt9tIBkRc9POUof7QA/VwWd+58fKkEEfI+/t1/eOlxKM7ZhrczNzMFefge7Ai+39y1pR/pP6cI19guHy3FSLmw==
@ -3210,6 +3220,11 @@ change-case@^3.0.2:
upper-case "^1.1.1"
upper-case-first "^1.1.0"
character-entities-html4@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-1.1.2.tgz#c44fdde3ce66b52e8d321d6c1bf46101f0150610"
integrity sha512-sIrXwyna2+5b0eB9W149izTPJk/KkJTg6mEzDGibwBUkyH1SbDa+nf515Ppdi3MaH35lW0JFJDWeq9Luzes1Iw==
character-entities-legacy@^1.0.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.2.tgz#7c6defb81648498222c9855309953d05f4d63a9c"
@ -4811,6 +4826,11 @@ elliptic@^6.0.0:
minimalistic-assert "^1.0.0"
minimalistic-crypto-utils "^1.0.0"
"emoji-regex@>=6.0.0 <=6.1.1":
version "6.1.1"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-6.1.1.tgz#c6cd0ec1b0642e2a3c67a1137efc5e796da4f88e"
integrity sha1-xs0OwbBkLio8Z6ETfvxeeW2k+I4=
emoji-regex@^7.0.2:
version "7.0.3"
resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
@ -6053,6 +6073,13 @@ gitconfiglocal@^1.0.0:
dependencies:
ini "^1.3.2"
github-slugger@^1.1.1, github-slugger@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.2.1.tgz#47e904e70bf2dccd0014748142d31126cfd49508"
integrity sha512-SsZUjg/P03KPzQBt7OxJPasGw6NRO5uOgiZ5RGXVud5iSIZ0eNZeNp5rTwCxtavrRUa/A77j8mePVc5lEvk0KQ==
dependencies:
emoji-regex ">=6.0.0 <=6.1.1"
glob-parent@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-3.1.0.tgz#9e6af6299d8d3bd2bd40430832bd113df906c5ae"
@ -6422,6 +6449,16 @@ hast-util-from-parse5@^5.0.0:
web-namespaces "^1.1.2"
xtend "^4.0.1"
hast-util-has-property@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/hast-util-has-property/-/hast-util-has-property-1.0.2.tgz#4c9c3c6122fcc84a5b7c40a573940aaa4b8a8278"
integrity sha512-EBzRiKIIe9wouLSjqun5ti0oYcEe5U1eEpuOPtcihmP3KvFRovOmmXypf1B/QalQr9S4YoVgLOSg6gW98ihRbA==
hast-util-is-element@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/hast-util-is-element/-/hast-util-is-element-1.0.2.tgz#c23c9428b6a5a4e323bf9e16f87417476314981b"
integrity sha512-4MEtyofNi3ZunPFrp9NpTQdNPN24xvLX3M+Lr/RGgPX6TLi+wR4/DqeoyQ7lwWcfUp4aevdt4RR0r7ZQPFbHxw==
hast-util-parse-selector@^2.2.0:
version "2.2.1"
resolved "https://registry.yarnpkg.com/hast-util-parse-selector/-/hast-util-parse-selector-2.2.1.tgz#4ddbae1ae12c124e3eb91b581d2556441766f0ab"
@ -7050,6 +7087,11 @@ is-alphabetical@^1.0.0, is-alphabetical@^1.0.2:
resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.2.tgz#1fa6e49213cb7885b75d15862fb3f3d96c884f41"
integrity sha512-V0xN4BYezDHcBSKb1QHUFMlR4as/XEuCZBzMJUU4n7+Cbt33SmUnSol+pnXFvLxSHNq2CemUXNdaXV6Flg7+xg==
is-alphanumeric@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-alphanumeric/-/is-alphanumeric-1.0.0.tgz#4a9cef71daf4c001c1d81d63d140cf53fd6889f4"
integrity sha1-Spzvcdr0wAHB2B1j0UDPU/1oifQ=
is-alphanumerical@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.2.tgz#1138e9ae5040158dc6ff76b820acd6b7a181fd40"
@ -8493,6 +8535,11 @@ lodash.templatesettings@^4.0.0:
dependencies:
lodash._reinterpolate "~3.0.0"
lodash.toarray@^4.4.0:
version "4.4.0"
resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"
integrity sha1-JMS/zWsvuji/0FlNsRedjptlZWE=
lodash.uniq@^4.5.0:
version "4.5.0"
resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
@ -8539,6 +8586,11 @@ loglevel@^1.4.1:
resolved "https://registry.yarnpkg.com/loglevel/-/loglevel-1.6.1.tgz#e0fc95133b6ef276cdc8887cdaf24aa6f156f8fa"
integrity sha1-4PyVEztu8nbNyIh82vJKpvFW+Po=
longest-streak@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.2.tgz#2421b6ba939a443bb9ffebf596585a50b4c38e2e"
integrity sha512-TmYTeEYxiAmSVdpbnQDXGtvYOIRsCMg89CVZzwzc2o7GFL1CjoiRPjH5ec0NFAVlAx3fVof9dX/t6KKRAo2OWA==
longest@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"
@ -8694,6 +8746,11 @@ markdown-link@^0.1.1:
resolved "https://registry.yarnpkg.com/markdown-link/-/markdown-link-0.1.1.tgz#32c5c65199a6457316322d1e4229d13407c8c7cf"
integrity sha1-MsXGUZmmRXMWMi0eQinRNAfIx88=
markdown-table@^1.1.0:
version "1.1.2"
resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-1.1.2.tgz#c78db948fa879903a41bce522e3b96f801c63786"
integrity sha512-NcWuJFHDA8V3wkDgR/j4+gZx+YQwstPgfQDV8ndUeWWzta3dnDTBxpVzqS9lkmJAuV5YX35lmyojl6HO5JXAgw==
markdown-toc@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/markdown-toc/-/markdown-toc-1.2.0.tgz#44a15606844490314afc0444483f9e7b1122c339"
@ -8738,6 +8795,13 @@ mdast-squeeze-paragraphs@^3.0.0:
dependencies:
unist-util-remove "^1.0.0"
mdast-util-compact@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/mdast-util-compact/-/mdast-util-compact-1.0.2.tgz#c12ebe16fffc84573d3e19767726de226e95f649"
integrity sha512-d2WS98JSDVbpSsBfVvD9TaDMlqPRz7ohM/11G0rp5jOBb5q96RJ6YLszQ/09AAixyzh23FeIpCGqfaamEADtWg==
dependencies:
unist-util-visit "^1.1.0"
mdast-util-definitions@^1.2.0:
version "1.2.3"
resolved "https://registry.yarnpkg.com/mdast-util-definitions/-/mdast-util-definitions-1.2.3.tgz#49f936b09207c45b438db19551652934312f04f0"
@ -8762,6 +8826,11 @@ mdast-util-to-hast@^4.0.0:
unist-util-visit "^1.1.0"
xtend "^4.0.1"
mdast-util-to-string@^1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-1.0.5.tgz#3552b05428af22ceda34f156afe62ec8e6d731ca"
integrity sha512-2qLt/DEOo5F6nc2VFScQiHPzQ0XXcabquRJxKMhKte8nt42o08HUxNDPk7tt0YPxnWjAT11I1SYi0X0iPnfI5A==
mdn-data@~1.1.0:
version "1.1.4"
resolved "https://registry.yarnpkg.com/mdn-data/-/mdn-data-1.1.4.tgz#50b5d4ffc4575276573c4eedb8780812a8419f01"
@ -9143,6 +9212,13 @@ no-case@^2.2.0, no-case@^2.3.2:
dependencies:
lower-case "^1.1.1"
node-emoji@^1.8.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.10.0.tgz#8886abd25d9c7bb61802a658523d1f8d2a89b2da"
integrity sha512-Yt3384If5H6BYGVHiHwTL+99OzJKHhgp82S8/dktEK73T26BazdgZ4JZh92xSVtGNJvz9UbXdNAc5hcrXV42vw==
dependencies:
lodash.toarray "^4.4.0"
node-fetch-npm@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-fetch-npm/-/node-fetch-npm-2.0.2.tgz#7258c9046182dca345b4208eda918daf33697ff7"
@ -9896,7 +9972,7 @@ parse-asn1@^5.0.0:
pbkdf2 "^3.0.3"
safe-buffer "^5.1.1"
parse-entities@^1.1.0, parse-entities@^1.1.2:
parse-entities@^1.0.2, parse-entities@^1.1.0, parse-entities@^1.1.2:
version "1.2.1"
resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-1.2.1.tgz#2c761ced065ba7dc68148580b5a225e4918cdd69"
integrity sha512-NBWYLQm1KSoDKk7GAHyioLTvCZ5QjdH/ASBBQTD3iLiAWJXS5bg1jEWI8nIJ+vgVvsceBVBcDGRWSo0KVQBvvg==
@ -11306,15 +11382,34 @@ regjsparser@^0.6.0:
dependencies:
jsesc "~0.5.0"
rehype-slug@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/rehype-slug/-/rehype-slug-2.0.2.tgz#a0d5a4118548ee6165b1f911a213a13e284d91ba"
integrity sha512-CDCRfqx4qgfOSDG6t9KoyvrLejrICqhDJu0kNY2r5RhZLr2QHp9gG533nLzp6HLTVT0fSbZbdx8YvqLGpCBjPA==
dependencies:
github-slugger "^1.1.1"
hast-util-has-property "^1.0.0"
hast-util-is-element "^1.0.0"
hast-util-to-string "^1.0.0"
unist-util-visit "^1.1.0"
relateurl@0.2.x:
version "0.2.7"
resolved "https://registry.yarnpkg.com/relateurl/-/relateurl-0.2.7.tgz#54dbf377e51440aca90a4cd274600d3ff2d888a9"
integrity sha1-VNvzd+UUQKypCkzSdGANP/LYiKk=
remark-mdx@^1.0.0-rc.0:
version "1.0.0-rc.0"
resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.0.0-rc.0.tgz#c6886f208bf7ca06368fd10a123106af7284dbac"
integrity sha512-hCh7/HV8aSGGWRudqThCXsxuu6j3FaXh5x2nfqLysm+50la2evldzXWxZmBU15WoNwTP5W4akXKFad+tMt1Eig==
remark-emoji@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/remark-emoji/-/remark-emoji-2.0.2.tgz#49c134021132c192ee4cceed1988ec9b8ced7eb8"
integrity sha512-E8ZOa7Sx1YS9ivWJ8U9xpA8ldzZ4VPAfyUaKqhr1/Pr5Q8ZdQHrpDg6S+rPzMw8t89KNViB/oG9ZdJSFDrUXpA==
dependencies:
node-emoji "^1.8.1"
unist-util-visit "^1.4.0"
remark-mdx@^1.0.14:
version "1.0.14"
resolved "https://registry.yarnpkg.com/remark-mdx/-/remark-mdx-1.0.14.tgz#6c32995d4b8ad0623bd6099a7e02a50fbe79c252"
integrity sha512-JMTp43LnFAPAEHBye+89pZQTYNuFX8YjOl19LUCtMaP6PcnK51aRLxbX0OikA/dvuI7KFQbIQMs2WscB4L57Gw==
dependencies:
"@babel/core" "^7.2.2"
"@babel/helper-plugin-utils" "^7.0.0"
@ -11352,6 +11447,35 @@ remark-squeeze-paragraphs@^3.0.1:
dependencies:
mdast-squeeze-paragraphs "^3.0.0"
remark-stringify@^6.0.0:
version "6.0.4"
resolved "https://registry.yarnpkg.com/remark-stringify/-/remark-stringify-6.0.4.tgz#16ac229d4d1593249018663c7bddf28aafc4e088"
integrity sha512-eRWGdEPMVudijE/psbIDNcnJLRVx3xhfuEsTDGgH4GsFF91dVhw5nhmnBppafJ7+NWINW6C7ZwWbi30ImJzqWg==
dependencies:
ccount "^1.0.0"
is-alphanumeric "^1.0.0"
is-decimal "^1.0.0"
is-whitespace-character "^1.0.0"
longest-streak "^2.0.1"
markdown-escapes "^1.0.0"
markdown-table "^1.1.0"
mdast-util-compact "^1.0.0"
parse-entities "^1.0.2"
repeat-string "^1.5.4"
state-toggle "^1.0.0"
stringify-entities "^1.0.1"
unherit "^1.0.4"
xtend "^4.0.1"
remark@^10.0.1:
version "10.0.1"
resolved "https://registry.yarnpkg.com/remark/-/remark-10.0.1.tgz#3058076dc41781bf505d8978c291485fe47667df"
integrity sha512-E6lMuoLIy2TyiokHprMjcWNJ5UxfGQjaMSMhV+f4idM625UjjK4j798+gPs5mfjzDE6vL0oFKVeZM6gZVSVrzQ==
dependencies:
remark-parse "^6.0.0"
remark-stringify "^6.0.0"
unified "^7.0.0"
remarkable@^1.7.1:
version "1.7.1"
resolved "https://registry.yarnpkg.com/remarkable/-/remarkable-1.7.1.tgz#aaca4972100b66a642a63a1021ca4bac1be3bff6"
@ -12367,7 +12491,17 @@ string_decoder@~1.1.1:
dependencies:
safe-buffer "~5.1.0"
stringify-object@^3.2.2:
stringify-entities@^1.0.1:
version "1.3.2"
resolved "https://registry.yarnpkg.com/stringify-entities/-/stringify-entities-1.3.2.tgz#a98417e5471fd227b3e45d3db1861c11caf668f7"
integrity sha512-nrBAQClJAPN2p+uGCVJRPIPakKeKWZ9GtBCmormE7pWOSlHat7+x5A8gx85M7HM5Dt0BP3pP5RhVW77WdbJJ3A==
dependencies:
character-entities-html4 "^1.0.0"
character-entities-legacy "^1.0.0"
is-alphanumerical "^1.0.0"
is-hexadecimal "^1.0.0"
stringify-object@^3.2.2, stringify-object@^3.3.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/stringify-object/-/stringify-object-3.3.0.tgz#703065aefca19300d3ce88af4f5b3956d7556629"
integrity sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==
@ -12831,6 +12965,14 @@ to-style@^1.3.3:
resolved "https://registry.yarnpkg.com/to-style/-/to-style-1.3.3.tgz#63a2b70a6f4a7d4fdc2ed57a0be4e7235cb6699c"
integrity sha1-Y6K3Cm9KfU/cLtV6C+TnI1y2aZw=
to-vfile@^5.0.2:
version "5.0.2"
resolved "https://registry.yarnpkg.com/to-vfile/-/to-vfile-5.0.2.tgz#7d402dd8dbe822cb80b924d4f13a56ee00ed8e49"
integrity sha512-Gp2q0HCUR+4At6c6mvFKug75NP/8Cu5r7ONvEcJJPBGiDT4HeLBrRnPKJbOe84nHJqYhIah2y367Tr2+IUkwMA==
dependencies:
is-buffer "^2.0.0"
vfile "^3.0.0"
toml@^2.3.2:
version "2.3.6"
resolved "https://registry.yarnpkg.com/toml/-/toml-2.3.6.tgz#25b0866483a9722474895559088b436fd11f861b"
@ -13149,7 +13291,7 @@ unist-util-visit-parents@^2.0.0:
dependencies:
unist-util-is "^2.1.2"
unist-util-visit@^1.0.0, unist-util-visit@^1.1.0, unist-util-visit@^1.1.3, unist-util-visit@^1.3.0:
unist-util-visit@^1.0.0, unist-util-visit@^1.1.0, unist-util-visit@^1.1.3, unist-util-visit@^1.3.0, unist-util-visit@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/unist-util-visit/-/unist-util-visit-1.4.0.tgz#1cb763647186dc26f5e1df5db6bd1e48b3cc2fb1"
integrity sha512-FiGu34ziNsZA3ZUteZxSFaczIjGmksfSgdKqBfOejrrfzyUy5b7YrlzT1Bcvi+djkYDituJDy2XB7tGTeBieKw==