diff options
Diffstat (limited to 'pages/uniorg.tsx')
-rw-r--r-- | pages/uniorg.tsx | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pages/uniorg.tsx b/pages/uniorg.tsx new file mode 100644 index 0000000..65786c9 --- /dev/null +++ b/pages/uniorg.tsx @@ -0,0 +1,25 @@ +import unified from 'unified' +import createStream from 'unified-stream' +import uniorgParse from 'uniorg-parse' +import uniorg2rehype from 'uniorg-rehype' +import highlight from 'rehype-highlight' +import katex from 'rehype-katex' +import rehype2react from 'rehype-react' +import React from 'react' + +export interface uniorgProps { + orgText: string +} + +const UniOrg = (props: uniorgProps) => { + const { orgText } = props + const processor = unified() + .use(uniorgParse) + .use(uniorg2rehype) + .use(katex) + .use(rehype2react, { createElement: React.createElement }) + + return <div>processor.processSync(orgText)</div> +} + +export default UniOrg |