mirror of
https://github.com/jxnblk/mdx-deck.git
synced 2024-11-26 00:35:02 +03:00
Prototype with custom mdx plugin
This commit is contained in:
parent
a14d4afb3e
commit
1df015397e
@ -71,6 +71,24 @@ const codeExample = require('./code-example')
|
|||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
export default props =>
|
||||||
|
<div
|
||||||
|
style={{
|
||||||
|
width: '100vw',
|
||||||
|
height: '100vh',
|
||||||
|
display: 'flex',
|
||||||
|
flexDirection: 'column',
|
||||||
|
alignItems: 'center',
|
||||||
|
justifyContent: 'center',
|
||||||
|
backgroundColor: 'tomato'
|
||||||
|
}}>
|
||||||
|
{props.children}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
## With a (tomato) layout
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
## Last Slide
|
## Last Slide
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,37 +1,22 @@
|
|||||||
const { getOptions } = require('loader-utils')
|
const { getOptions } = require('loader-utils')
|
||||||
const mdx = require('@mdx-js/mdx')
|
const mdx = require('@mdx-js/mdx')
|
||||||
const normalizeNewline = require('normalize-newline')
|
// const normalizeNewline = require('normalize-newline')
|
||||||
// const splitPlugin = require('./split-plugin')
|
const mdxPluginSplit = require('mdx-plugin-split')
|
||||||
|
|
||||||
const SLIDEREG = /\n---\n/
|
|
||||||
|
|
||||||
module.exports = async function(src) {
|
module.exports = async function(src) {
|
||||||
const callback = this.async()
|
const callback = this.async()
|
||||||
const options = getOptions(this) || {}
|
const options = getOptions(this) || {}
|
||||||
options.skipExport = true
|
// options.skipExport = true
|
||||||
// options.hastPlugins = [ splitPlugin ]
|
options.mdPlugins = options.mdPlugins || []
|
||||||
|
options.mdPlugins.push(mdxPluginSplit)
|
||||||
|
|
||||||
const modules = []
|
const result = mdx.sync(src, options)
|
||||||
const slides = normalizeNewline(src)
|
|
||||||
.split(SLIDEREG)
|
|
||||||
.map(str => {
|
|
||||||
const code = mdx.sync(str, options)
|
|
||||||
const lines = code.split('\n')
|
|
||||||
const tagIndex = lines.findIndex(str => /^</.test(str))
|
|
||||||
modules.push(...lines.slice(0, tagIndex).filter(Boolean))
|
|
||||||
const jsx = lines.slice(tagIndex).join('\n')
|
|
||||||
|
|
||||||
return `({ components, ...props }) => ${jsx}`
|
|
||||||
})
|
|
||||||
.map(str => str.trim())
|
|
||||||
|
|
||||||
const code = `import React from 'react'
|
const code = `import React from 'react'
|
||||||
import { MDXTag } from '@mdx-js/tag'
|
import { MDXTag } from '@mdx-js/tag'
|
||||||
${modules.join('\n')}
|
${result}`
|
||||||
|
|
||||||
export default [
|
console.log(code)
|
||||||
${slides.join(',\n\n')}
|
|
||||||
]`
|
|
||||||
|
|
||||||
return callback(null, code)
|
return callback(null, code)
|
||||||
}
|
}
|
||||||
|
243
package-lock.json
generated
243
package-lock.json
generated
@ -1110,29 +1110,28 @@
|
|||||||
"integrity": "sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg=="
|
"integrity": "sha512-4zAPlpDEh2VwXswwr/t8xGNDGg8RQiPxtxZ3qQEXyQsBV39ptTdESCjuBvGze1nLMVrxmTIKmnO/nAV8Tqjjzg=="
|
||||||
},
|
},
|
||||||
"@mdx-js/mdx": {
|
"@mdx-js/mdx": {
|
||||||
"version": "0.15.7",
|
"version": "0.20.0",
|
||||||
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-0.15.7.tgz",
|
"resolved": "https://registry.npmjs.org/@mdx-js/mdx/-/mdx-0.20.0.tgz",
|
||||||
"integrity": "sha512-bWUQidQhjTRFh5nK01kW3qQLCH/aCq6VTapOZ/+WI5hL4exoRw6TgnxxmgSf/p7mmrGxIpCHmnaWXdbHSObxlg==",
|
"integrity": "sha512-8kJN/7jvnWu/zdSuc0yDhGTk2jaDlAin0mfE8FoUBxDHpoOM8OZ4OW9MRKmEWMued9RpOgozbUhK4kKzaW/nGA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@babel/plugin-proposal-object-rest-spread": "^7.3.2",
|
||||||
|
"@babel/plugin-syntax-jsx": "^7.2.0",
|
||||||
"change-case": "^3.0.2",
|
"change-case": "^3.0.2",
|
||||||
"detab": "^2.0.0",
|
"detab": "^2.0.0",
|
||||||
"mdast-util-to-hast": "^3.0.0",
|
"hast-util-raw": "^5.0.0",
|
||||||
"remark-parse": "^5.0.0",
|
"mdast-util-to-hast": "^4.0.0",
|
||||||
|
"remark-parse": "^6.0.0",
|
||||||
"remark-squeeze-paragraphs": "^3.0.1",
|
"remark-squeeze-paragraphs": "^3.0.1",
|
||||||
"to-style": "^1.3.3",
|
"to-style": "^1.3.3",
|
||||||
"unified": "^6.1.6",
|
"unified": "^7.0.0",
|
||||||
|
"unist-builder": "^1.0.1",
|
||||||
"unist-util-visit": "^1.3.0"
|
"unist-util-visit": "^1.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@mdx-js/tag": {
|
"@mdx-js/tag": {
|
||||||
"version": "0.15.6",
|
"version": "0.18.0",
|
||||||
"resolved": "https://registry.npmjs.org/@mdx-js/tag/-/tag-0.15.6.tgz",
|
"resolved": "https://registry.npmjs.org/@mdx-js/tag/-/tag-0.18.0.tgz",
|
||||||
"integrity": "sha512-u1H93/n7t2XE69fWiKIQIcnSHIHV9LgOew09rrzu+ceF+TK8jMacE2FxW09lQDUyL/Rat3fJDS4dQdTY8g/ZdQ==",
|
"integrity": "sha512-3g1NOnbw+sJZohNOEN9NlaYYDdzq1y34S7PDimSn3zLV8etCu7pTCMFbnFHMSe6mMmm4yJ1gfbS3QiE7t+WMGA=="
|
||||||
"requires": {
|
|
||||||
"create-react-context": "^0.2.2",
|
|
||||||
"hoist-non-react-statics": "^2.5.5",
|
|
||||||
"prop-types": "^15.6.1"
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"@mrmlnc/readdir-enhanced": {
|
"@mrmlnc/readdir-enhanced": {
|
||||||
"version": "2.2.1",
|
"version": "2.2.1",
|
||||||
@ -1178,6 +1177,35 @@
|
|||||||
"any-observable": "^0.3.0"
|
"any-observable": "^0.3.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"@types/node": {
|
||||||
|
"version": "11.10.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-11.10.4.tgz",
|
||||||
|
"integrity": "sha512-wa09itaLE8L705aXd8F80jnFpxz3Y1/KRHfKsYL2bPc0XF+wEWu8sR9n5bmeu8Ba1N9z2GRNzm/YdHcghLkLKg=="
|
||||||
|
},
|
||||||
|
"@types/unist": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-FvUupuM3rlRsRtCN+fDudtmytGO6iHJuuRKS1Ss0pG5z8oX0diNEw94UEL7hgDbpN94rgaK5R7sWm6RrSkZuAQ=="
|
||||||
|
},
|
||||||
|
"@types/vfile": {
|
||||||
|
"version": "3.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/vfile/-/vfile-3.0.2.tgz",
|
||||||
|
"integrity": "sha512-b3nLFGaGkJ9rzOcuXRfHkZMdjsawuDD0ENL9fzTophtBg8FJHSGbH7daXkEpcwy3v7Xol3pAvsmlYyFhR4pqJw==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"@types/unist": "*",
|
||||||
|
"@types/vfile-message": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"@types/vfile-message": {
|
||||||
|
"version": "1.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/vfile-message/-/vfile-message-1.0.1.tgz",
|
||||||
|
"integrity": "sha512-mlGER3Aqmq7bqR1tTTIVHq8KSAFFRyGbrxuM8C/H82g6k7r2fS+IMEkIu3D7JHzG10NvPdR8DNx0jr0pwpp4dA==",
|
||||||
|
"requires": {
|
||||||
|
"@types/node": "*",
|
||||||
|
"@types/unist": "*"
|
||||||
|
}
|
||||||
|
},
|
||||||
"@webassemblyjs/ast": {
|
"@webassemblyjs/ast": {
|
||||||
"version": "1.8.5",
|
"version": "1.8.5",
|
||||||
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
|
"resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.8.5.tgz",
|
||||||
@ -2171,6 +2199,11 @@
|
|||||||
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
|
"integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"ccount": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ccount/-/ccount-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-Jt9tIBkRc9POUof7QA/VwWd+58fKkEEfI+/t1/eOlxKM7ZhrczNzMFefge7Ai+39y1pR/pP6cI19guHy3FSLmw=="
|
||||||
|
},
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "2.4.2",
|
"version": "2.4.2",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
"resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
|
||||||
@ -2931,6 +2964,14 @@
|
|||||||
"delayed-stream": "~1.0.0"
|
"delayed-stream": "~1.0.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"comma-separated-tokens": {
|
||||||
|
"version": "1.0.5",
|
||||||
|
"resolved": "https://registry.npmjs.org/comma-separated-tokens/-/comma-separated-tokens-1.0.5.tgz",
|
||||||
|
"integrity": "sha512-Cg90/fcK93n0ecgYTAz1jaA3zvnQ0ExlmKY1rdbyHqAx6BHxwoJc+J7HDu0iuQ7ixEs1qaa+WyQ6oeuBpYP1iA==",
|
||||||
|
"requires": {
|
||||||
|
"trim": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"commander": {
|
"commander": {
|
||||||
"version": "2.19.0",
|
"version": "2.19.0",
|
||||||
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
|
"resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz",
|
||||||
@ -3176,7 +3217,6 @@
|
|||||||
"version": "2.2.4",
|
"version": "2.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
|
"resolved": "https://registry.npmjs.org/css/-/css-2.2.4.tgz",
|
||||||
"integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==",
|
"integrity": "sha512-oUnjmWpy0niI3x/mPL8dVEI1l7MnG3+HHyRPHf+YFSbK+svOhXpmSOcDURUh2aOCgl2grzrOPt1nHLuCVFULLw==",
|
||||||
"dev": true,
|
|
||||||
"requires": {
|
"requires": {
|
||||||
"inherits": "^2.0.3",
|
"inherits": "^2.0.3",
|
||||||
"source-map": "^0.6.1",
|
"source-map": "^0.6.1",
|
||||||
@ -5062,6 +5102,81 @@
|
|||||||
"minimalistic-assert": "^1.0.1"
|
"minimalistic-assert": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"hast-to-hyperscript": {
|
||||||
|
"version": "6.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/hast-to-hyperscript/-/hast-to-hyperscript-6.0.0.tgz",
|
||||||
|
"integrity": "sha512-QnJbXddVGNJ5v3KegK1MY6luTkNDBcJnCQZcekt7AkES2z4tYy85pbFUXx7Mb0iXZBKfwoVdgfxU12GbmlwbbQ==",
|
||||||
|
"requires": {
|
||||||
|
"comma-separated-tokens": "^1.0.0",
|
||||||
|
"property-information": "^5.0.0",
|
||||||
|
"space-separated-tokens": "^1.0.0",
|
||||||
|
"style-to-object": "^0.2.1",
|
||||||
|
"unist-util-is": "^2.0.0",
|
||||||
|
"web-namespaces": "^1.1.2"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hast-util-from-parse5": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/hast-util-from-parse5/-/hast-util-from-parse5-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-A7ev5OseS/J15214cvDdcI62uwovJO2PB60Xhnq7kaxvvQRFDEccuqbkrFXU03GPBGopdPqlpQBRqIcDS/Fjbg==",
|
||||||
|
"requires": {
|
||||||
|
"ccount": "^1.0.3",
|
||||||
|
"hastscript": "^5.0.0",
|
||||||
|
"property-information": "^5.0.0",
|
||||||
|
"web-namespaces": "^1.1.2",
|
||||||
|
"xtend": "^4.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hast-util-parse-selector": {
|
||||||
|
"version": "2.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/hast-util-parse-selector/-/hast-util-parse-selector-2.2.1.tgz",
|
||||||
|
"integrity": "sha512-Xyh0v+nHmQvrOqop2Jqd8gOdyQtE8sIP9IQf7mlVDqp924W4w/8Liuguk2L2qei9hARnQSG2m+wAOCxM7npJVw=="
|
||||||
|
},
|
||||||
|
"hast-util-raw": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/hast-util-raw/-/hast-util-raw-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-X8sogDDaCkqj+Ghia0+TRD2AQDXeNRpYDTm9Z2mJ1Pzy/Nb4p20YJVfbPwIRU0U7XXU0GrhPhEMZvnfV69/igA==",
|
||||||
|
"requires": {
|
||||||
|
"hast-util-from-parse5": "^5.0.0",
|
||||||
|
"hast-util-to-parse5": "^5.0.0",
|
||||||
|
"html-void-elements": "^1.0.1",
|
||||||
|
"parse5": "^5.0.0",
|
||||||
|
"unist-util-position": "^3.0.0",
|
||||||
|
"web-namespaces": "^1.0.0",
|
||||||
|
"xtend": "^4.0.1",
|
||||||
|
"zwitch": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"parse5": {
|
||||||
|
"version": "5.1.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.0.tgz",
|
||||||
|
"integrity": "sha512-fxNG2sQjHvlVAYmzBZS9YlDp6PTSSDwa98vkD4QgVDDCAo84z5X1t5XyJQ62ImdLXx5NdIIfihey6xpum9/gRQ=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hast-util-to-parse5": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/hast-util-to-parse5/-/hast-util-to-parse5-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-1BG07SLp9RHnAy/A2Fugza5YCo45Ter8csOGbxL7a7f9Rvq9aE64/4hlqc083M8yLLp7J5tYxmiFWYbD0zQJnA==",
|
||||||
|
"requires": {
|
||||||
|
"hast-to-hyperscript": "^6.0.0",
|
||||||
|
"property-information": "^5.0.0",
|
||||||
|
"web-namespaces": "^1.0.0",
|
||||||
|
"xtend": "^4.0.1",
|
||||||
|
"zwitch": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"hastscript": {
|
||||||
|
"version": "5.0.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/hastscript/-/hastscript-5.0.0.tgz",
|
||||||
|
"integrity": "sha512-xJtuJ8D42Xtq5yJrnDg/KAIxl2cXBXKoiIJwmWX9XMf8113qHTGl/Bf7jEsxmENJ4w6q4Tfl8s/Y6mEZo8x8qw==",
|
||||||
|
"requires": {
|
||||||
|
"comma-separated-tokens": "^1.0.0",
|
||||||
|
"hast-util-parse-selector": "^2.2.0",
|
||||||
|
"property-information": "^5.0.1",
|
||||||
|
"space-separated-tokens": "^1.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"header-case": {
|
"header-case": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/header-case/-/header-case-1.0.1.tgz",
|
||||||
@ -5086,11 +5201,6 @@
|
|||||||
"minimalistic-crypto-utils": "^1.0.1"
|
"minimalistic-crypto-utils": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"hoist-non-react-statics": {
|
|
||||||
"version": "2.5.5",
|
|
||||||
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-2.5.5.tgz",
|
|
||||||
"integrity": "sha512-rqcy4pJo55FTTLWt+bU8ukscqHeE/e9KWvsOW2b/a3afxQZhwkQdT1rPPCJ0rYXdj4vNcasY8zHTH+jF/qStxw=="
|
|
||||||
},
|
|
||||||
"hosted-git-info": {
|
"hosted-git-info": {
|
||||||
"version": "2.7.1",
|
"version": "2.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz",
|
||||||
@ -5110,6 +5220,11 @@
|
|||||||
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz",
|
"resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.2.1.tgz",
|
||||||
"integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8="
|
"integrity": "sha1-DfKTUfByEWNRXfueVUPl9u7VFi8="
|
||||||
},
|
},
|
||||||
|
"html-void-elements": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/html-void-elements/-/html-void-elements-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-SaGhCDPXJVNrQyKMtKy24q6IMdXg5FCPN3z+xizxw9l+oXQw5fOoaj/ERU5KqWhSYhXtW5bWthlDbTDLBhJQrA=="
|
||||||
|
},
|
||||||
"http-parser-js": {
|
"http-parser-js": {
|
||||||
"version": "0.5.0",
|
"version": "0.5.0",
|
||||||
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.0.tgz",
|
"resolved": "https://registry.npmjs.org/http-parser-js/-/http-parser-js-0.5.0.tgz",
|
||||||
@ -6966,7 +7081,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"chalk": {
|
"chalk": {
|
||||||
"version": "1.1.3",
|
"version": "1.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
"resolved": "http://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz",
|
||||||
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
@ -7270,9 +7385,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"mdast-util-to-hast": {
|
"mdast-util-to-hast": {
|
||||||
"version": "3.0.4",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/mdast-util-to-hast/-/mdast-util-to-hast-4.0.0.tgz",
|
||||||
"integrity": "sha512-/eIbly2YmyVgpJNo+bFLLMCI1XgolO/Ffowhf+pHDq3X4/V6FntC9sGQCDLM147eTS+uSXv5dRzJyFn+o0tazA==",
|
"integrity": "sha512-yOTZSxR1aPvWRUxVeLaLZ1sCYrK87x2Wusp1bDM/Ao2jETBhYUKITI3nHvgy+HkZW54HuCAhHnS0mTcbECD5Ig==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"collapse-white-space": "^1.0.0",
|
"collapse-white-space": "^1.0.0",
|
||||||
"detab": "^2.0.0",
|
"detab": "^2.0.0",
|
||||||
@ -7302,6 +7417,15 @@
|
|||||||
"memoize-one": "^4.0.2"
|
"memoize-one": "^4.0.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"mdx-plugin-split": {
|
||||||
|
"version": "0.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/mdx-plugin-split/-/mdx-plugin-split-0.0.2.tgz",
|
||||||
|
"integrity": "sha512-Kl8H0CVO4QPJ1AZ+Weaf7uHMB+px4uffZ2h3tl7ItcvU4VJkASRjeFYJN5GtQbmM8RpXTgxyp+xfaQqHOClNXQ==",
|
||||||
|
"requires": {
|
||||||
|
"unist-util-is": "^2.1.2",
|
||||||
|
"unist-util-visit": "^1.4.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"mem": {
|
"mem": {
|
||||||
"version": "4.1.0",
|
"version": "4.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz",
|
||||||
@ -8078,9 +8202,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"parse-entities": {
|
"parse-entities": {
|
||||||
"version": "1.2.0",
|
"version": "1.2.1",
|
||||||
"resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/parse-entities/-/parse-entities-1.2.1.tgz",
|
||||||
"integrity": "sha512-XXtDdOPLSB0sHecbEapQi6/58U/ODj/KWfIXmmMCJF/eRn8laX6LZbOyioMoETOOJoWRW8/qTSl5VQkUIfKM5g==",
|
"integrity": "sha512-NBWYLQm1KSoDKk7GAHyioLTvCZ5QjdH/ASBBQTD3iLiAWJXS5bg1jEWI8nIJ+vgVvsceBVBcDGRWSo0KVQBvvg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"character-entities": "^1.0.0",
|
"character-entities": "^1.0.0",
|
||||||
"character-entities-legacy": "^1.0.0",
|
"character-entities-legacy": "^1.0.0",
|
||||||
@ -8377,6 +8501,14 @@
|
|||||||
"integrity": "sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g==",
|
"integrity": "sha512-CGuc0VUTGthpJXL36ydB6jnbyOf/rAHFvmVrJlH+Rg0DqqLFQGAP6hIaxD/G0OAmBJPhXDHuEJigrp0e0wFV6g==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
|
"property-information": {
|
||||||
|
"version": "5.0.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/property-information/-/property-information-5.0.1.tgz",
|
||||||
|
"integrity": "sha512-nAtBDVeSwFM3Ot/YxT7s4NqZmqXI7lLzf46BThvotEtYf2uk2yH0ACYuWQkJ7gxKs49PPtKVY0UlDGkyN9aJlw==",
|
||||||
|
"requires": {
|
||||||
|
"xtend": "^4.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"prr": {
|
"prr": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz",
|
||||||
@ -8789,9 +8921,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"remark-parse": {
|
"remark-parse": {
|
||||||
"version": "5.0.0",
|
"version": "6.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-5.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/remark-parse/-/remark-parse-6.0.3.tgz",
|
||||||
"integrity": "sha512-b3iXszZLH1TLoyUzrATcTQUZrwNl1rE70rVdSruJFlDaJ9z5aMkhrG43Pp68OgfHndL/ADz6V69Zow8cTQu+JA==",
|
"integrity": "sha512-QbDXWN4HfKTUC0hHa4teU463KclLAnwpn/FBn87j9cKYJWWawbiLgMfP2Q4XwhxxuuuOxHlw+pSN0OKuJwyVvg==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"collapse-white-space": "^1.0.2",
|
"collapse-white-space": "^1.0.2",
|
||||||
"is-alphabetical": "^1.0.0",
|
"is-alphabetical": "^1.0.0",
|
||||||
@ -9504,6 +9636,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz",
|
||||||
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
|
"integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM="
|
||||||
},
|
},
|
||||||
|
"space-separated-tokens": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/space-separated-tokens/-/space-separated-tokens-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-G3jprCEw+xFEs0ORweLmblJ3XLymGGr6hxZYTYZjIlvDti9vOBUjRQa1Rzjt012aRrocKstHwdNi+F7HguPsEA==",
|
||||||
|
"requires": {
|
||||||
|
"trim": "0.0.1"
|
||||||
|
}
|
||||||
|
},
|
||||||
"spdx-correct": {
|
"spdx-correct": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.0.0.tgz",
|
||||||
@ -9787,6 +9927,14 @@
|
|||||||
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz",
|
||||||
"integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g="
|
"integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g="
|
||||||
},
|
},
|
||||||
|
"style-to-object": {
|
||||||
|
"version": "0.2.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-0.2.2.tgz",
|
||||||
|
"integrity": "sha512-GcbtvfsqyKmIPpHeOHZ5Rmwsx2MDJct4W9apmTGcbPTbpA2FcgTFl2Z43Hm4Qb61MWGPNK8Chki7ITiY7lLOow==",
|
||||||
|
"requires": {
|
||||||
|
"css": "2.2.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
"styled-components": {
|
"styled-components": {
|
||||||
"version": "4.1.3",
|
"version": "4.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-4.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/styled-components/-/styled-components-4.1.3.tgz",
|
||||||
@ -10209,15 +10357,17 @@
|
|||||||
"integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg=="
|
"integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg=="
|
||||||
},
|
},
|
||||||
"unified": {
|
"unified": {
|
||||||
"version": "6.2.0",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/unified/-/unified-6.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/unified/-/unified-7.1.0.tgz",
|
||||||
"integrity": "sha512-1k+KPhlVtqmG99RaTbAv/usu85fcSRu3wY8X+vnsEhIxNP5VbVIDiXnLqyKIG+UMdyTg0ZX9EI6k2AfjJkHPtA==",
|
"integrity": "sha512-lbk82UOIGuCEsZhPj8rNAkXSDXd6p0QLzIuSsCdxrqnqU56St4eyOB+AlXsVgVeRmetPTYydIuvFfpDIed8mqw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
|
"@types/unist": "^2.0.0",
|
||||||
|
"@types/vfile": "^3.0.0",
|
||||||
"bail": "^1.0.0",
|
"bail": "^1.0.0",
|
||||||
"extend": "^3.0.0",
|
"extend": "^3.0.0",
|
||||||
"is-plain-obj": "^1.1.0",
|
"is-plain-obj": "^1.1.0",
|
||||||
"trough": "^1.0.0",
|
"trough": "^1.0.0",
|
||||||
"vfile": "^2.0.0",
|
"vfile": "^3.0.0",
|
||||||
"x-is-string": "^0.1.0"
|
"x-is-string": "^0.1.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -10476,14 +10626,21 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vfile": {
|
"vfile": {
|
||||||
"version": "2.3.0",
|
"version": "3.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/vfile/-/vfile-2.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/vfile/-/vfile-3.0.1.tgz",
|
||||||
"integrity": "sha512-ASt4mBUHcTpMKD/l5Q+WJXNtshlWxOogYyGYYrg4lt/vuRjC1EFQtlAofL5VmtVNIZJzWYFJjzGWZ0Gw8pzW1w==",
|
"integrity": "sha512-y7Y3gH9BsUSdD4KzHsuMaCzRjglXN0W2EcMf0gpvu6+SbsGhMje7xDc8AEoeXy6mIwCKMI6BkjMsRjzQbhMEjQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"is-buffer": "^1.1.4",
|
"is-buffer": "^2.0.0",
|
||||||
"replace-ext": "1.0.0",
|
"replace-ext": "1.0.0",
|
||||||
"unist-util-stringify-position": "^1.0.0",
|
"unist-util-stringify-position": "^1.0.0",
|
||||||
"vfile-message": "^1.0.0"
|
"vfile-message": "^1.0.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"is-buffer": {
|
||||||
|
"version": "2.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.3.tgz",
|
||||||
|
"integrity": "sha512-U15Q7MXTuZlrbymiz95PJpZxu8IlipAp4dtS3wOdgPXx3mqBnslrWU14kxfHB+Py/+2PVKSr37dMAgM2A4uArw=="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"vfile-location": {
|
"vfile-location": {
|
||||||
@ -10561,6 +10718,11 @@
|
|||||||
"neo-async": "^2.5.0"
|
"neo-async": "^2.5.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"web-namespaces": {
|
||||||
|
"version": "1.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/web-namespaces/-/web-namespaces-1.1.2.tgz",
|
||||||
|
"integrity": "sha512-II+n2ms4mPxK+RnIxRPOw3zwF2jRscdJIUE9BfkKHm4FYEg9+biIoTMnaZF5MpemE3T+VhMLrhbyD4ilkPCSbg=="
|
||||||
|
},
|
||||||
"webidl-conversions": {
|
"webidl-conversions": {
|
||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz",
|
||||||
@ -10994,6 +11156,11 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"zwitch": {
|
||||||
|
"version": "1.0.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/zwitch/-/zwitch-1.0.3.tgz",
|
||||||
|
"integrity": "sha512-aynRpmJDw7JIq6X4NDWJoiK1yVSiG57ArWSg4HLC1SFupX5/bo0Cf4jpX0ifwuzBfxpYBuNSyvMlWNNRuy3cVA=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,8 +7,7 @@
|
|||||||
"mdx-deck": "./cli.js"
|
"mdx-deck": "./cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"_start": "./cli.js docs/index.mdx -p 8080",
|
"start": "./cli.js docs/index.mdx -p 8080",
|
||||||
"start": "./cli.js docs/test.mdx -p 8080",
|
|
||||||
"build": "./cli.js build docs/index.mdx -d site",
|
"build": "./cli.js build docs/index.mdx -d site",
|
||||||
"help": "./cli.js",
|
"help": "./cli.js",
|
||||||
"test": "jest"
|
"test": "jest"
|
||||||
@ -25,8 +24,8 @@
|
|||||||
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
|
||||||
"@babel/preset-env": "^7.3.4",
|
"@babel/preset-env": "^7.3.4",
|
||||||
"@babel/preset-react": "^7.0.0",
|
"@babel/preset-react": "^7.0.0",
|
||||||
"@mdx-js/mdx": "^0.15.7",
|
"@mdx-js/mdx": "^0.20.0",
|
||||||
"@mdx-js/tag": "^0.15.6",
|
"@mdx-js/tag": "^0.18.0",
|
||||||
"@reach/router": "^1.2.1",
|
"@reach/router": "^1.2.1",
|
||||||
"babel-loader": "^8.0.5",
|
"babel-loader": "^8.0.5",
|
||||||
"babel-plugin-styled-components": "^1.10.0",
|
"babel-plugin-styled-components": "^1.10.0",
|
||||||
@ -39,6 +38,7 @@
|
|||||||
"loader-utils": "^1.2.3",
|
"loader-utils": "^1.2.3",
|
||||||
"lodash.debounce": "^4.0.8",
|
"lodash.debounce": "^4.0.8",
|
||||||
"lodash.get": "^4.4.2",
|
"lodash.get": "^4.4.2",
|
||||||
|
"mdx-plugin-split": "0.0.2",
|
||||||
"meow": "^5.0.0",
|
"meow": "^5.0.0",
|
||||||
"mkdirp": "^0.5.1",
|
"mkdirp": "^0.5.1",
|
||||||
"normalize-newline": "^3.0.0",
|
"normalize-newline": "^3.0.0",
|
||||||
|
@ -3,9 +3,11 @@ import { render } from 'react-dom'
|
|||||||
import { MDXDeck } from './index'
|
import { MDXDeck } from './index'
|
||||||
|
|
||||||
const mod = require(FILENAME)
|
const mod = require(FILENAME)
|
||||||
const slides = mod.default
|
const { slides } = mod
|
||||||
const { theme, components, Provider } = mod
|
const { theme, components, Provider } = mod
|
||||||
|
|
||||||
|
console.log(slides)
|
||||||
|
|
||||||
export default class App extends React.Component {
|
export default class App extends React.Component {
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
Loading…
Reference in New Issue
Block a user