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

Readme

Keywords

none

Package Sidebar

Install

npm i gatsby-remark-import-code

Weekly Downloads

148

Version

0.1.1

License

MIT

Unpacked Size

2.84 kB

Total Files

4

Last publish

Collaborators

  • pomber