Migrate to Netlify Today

Netlify announces the next evolution of Gatsby Cloud. Learn more

ContactSign Up
Community Plugin
View plugin on GitHub

gatsby-remark-prismjs-spectre

Adds syntax highlighting to code blocks in markdown files to match with the spectre.css stylesheet

Install

npm install --save gatsby-transformer-remark gatsby-remark-prismjs-spectre prismjs

How to use

// In your gatsby-config.js
plugins: [
  {
    resolve: `gatsby-transformer-remark`,
    options: {
      plugins: [
        {
          resolve: `gatsby-remark-prismjs-spectre`,
          options: {
            // This is used to allow setting a language for inline code
            // (i.e. single backticks) by creating a separator.
            // This separator is a string and will do no white-space
            // stripping.
            // A suggested value for English speakers is the non-ascii
            // character '›'.
            inlineCodeMarker: null,
            // This lets you set up language aliases.  For example,
            // setting this to '{ sh: "bash" }' will let you use
            // the language "sh" which will highlight using the
            // bash highlighter.
            aliases: {},
          },
        },
      ],
    },
  },
]

Usage

Refer to the usage specified in gatsby-remark-prismjs. I’ll flesh this README out some other time.

© 2023 Gatsby, Inc.