gatsby-remark-import-code

0.1.1 • Public • Published

gatsby-remark-import-code

Install

$ npm install gatsby-remark-import-code

Use

Use it together with gatsby-plugin-mdx. In gatsby-config.js:

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-mdx`,
      options: {
        gatsbyRemarkPlugins: [`gatsby-remark-import-code`]
      }
    }
  ]
};

It transforms md/mdx code blocks from this:

```js file=./hello-world.js
```

into:

```js
function helloWorld() {
  return "hello world";
}
```

Related

Dependencies (2)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i gatsby-remark-import-code

    Weekly Downloads

    182

    Version

    0.1.1

    License

    MIT

    Unpacked Size

    2.84 kB

    Total Files

    4

    Last publish

    Collaborators

    • pomber