[#819,xlsx][m]: remove data-literate, excel and everything related to the xlsx dependency (#845)

This commit is contained in:
João Demenech
2023-05-04 13:42:13 -03:00
committed by GitHub
parent ad52721a38
commit 90b93e6819
10 changed files with 2 additions and 646 deletions

View File

@@ -1,35 +0,0 @@
// Used by Data Literate
import matter from 'gray-matter'
import toc from 'remark-toc'
import slug from 'remark-slug'
import gfm from 'remark-gfm'
import footnotes from 'remark-footnotes'
import { serialize } from 'next-mdx-remote/serialize'
/**
* Parse a markdown or MDX file to an MDX source form + front matter data
*
* @source: the contents of a markdown or mdx file
* @returns: { mdxSource: mdxSource, frontMatter: ...}
*/
const parse = async function(source) {
const { content, data } = matter(source)
const mdxSource = await serialize(content, {
// Optionally pass remark/rehype plugins
mdxOptions: {
remarkPlugins: [gfm, toc, slug, footnotes],
rehypePlugins: [],
},
scope: data,
})
return {
mdxSource: mdxSource,
frontMatter: data
}
}
export default parse