docusaurus/packages/docusaurus-mdx-loader
Yangshun Tay 23b50f17a1
refactor(v2): blog data revamp (#1450)
* refactor(v2): blog data revamp

* fix(v2): fix incorrect blog total count

* misc: remove console.log

* feat(v2): export frontMatter as an object within MDX file (#1451)

* refactor. Don't confuse metadata & frontmatter

* export frontMatter in content itself

* nits

* nits name

* dont truncate first four lines in blog
2019-05-13 00:16:15 -07:00
..
src refactor(v2): blog data revamp (#1450) 2019-05-13 00:16:15 -07:00
package.json refactor(v2): blog data revamp (#1450) 2019-05-13 00:16:15 -07:00
README.md fix(v2): only import prism css on browser 2019-04-14 01:02:34 +08:00

@docusaurus/mdx-loader

Docusaurus webpack loader of MDX

The extra idea here is to simplify things by adding prismjs syntax highlighting by default through https://github.com/mapbox/rehype-prism and add the prism css theme import directly (only add the CSS import if target is 'web').

Installation

yarn add @docusaurus/mdx-loader

Usage


// ...
module: {
  rules: [
    // ...
    {
        test: /\.css$/,
        // Make sure your webpack loader can import css files too
    },
    {
      test: /\.mdx?$/,
      use: [
        'babel-loader',
        {
            loader: '@docuaurus/mdx-loader',
            options: {
                // .. See options
            }
        }
      ]
    }
  ]
}

Options

prismTheme

  • Default: prism-themes/themes/prism-atom-dark.css;

This is the PrismJS theme CSS that will be imported. The supported themes are :