Package Exports
- gatsby-remark-prismjs
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gatsby-remark-prismjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
gatsby-remark-prismjs
Adds syntax highlighting to code blocks in markdown files using PrismJS.
Install
npm install --save gatsby-remark-prismjs
How to use
// In your gatsby-config.js
plugins: [
{
resolve: `gatsby-transformer-remark`,
options: {
plugins: [
`gatsby-remark-prismjs`,
]
}
}
]PrismJS themes
You'll also need to add a PrismJS theme. Prism ships with a number of themes you can try or you can build your own by copying and modifying an example (what we've done on gatsbyjs.org).
To load a theme, simply require its CSS file in your
layouts/default.js file.
E.g.
// layouts/default.js
require('prismjs/themes/prism-solarizedlight.css')