Skip to content

Document PrismJS theming #1173

Description

@alexkrolick

📚 Documentation

Hihglight.js hasn't made progress on support for JSX in over two years, so a lot React-based projects will need to use Prism for highlighting instead. It seems like Prism understands the highlight.theme config option but it's unclear where it gets its themes - they don't have the same names as the Highlight.js ones except in a few cases like "default", and even then they look different.

{
  // Highlight.js doesn't work well with JSX
  // pass an array of languages to use Prism, or true for all
  // usePrism: ['jsx'],
  usePrism: true,

  highlight: {
    // Highlight.js theme to use for syntax highlighting in code blocks.
    // Need to pass a value here that also works with Prism
    // theme: 'gruvbox-dark',
    theme: "default",
    defaultLang: "javascript"
  },
}

Have you read the Contributing Guidelines on issues?

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions