Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document PrismJS theming #1173

Closed
alexkrolick opened this issue Dec 30, 2018 · 1 comment
Closed

Document PrismJS theming #1173

alexkrolick opened this issue Dec 30, 2018 · 1 comment

Comments

@alexkrolick
Copy link
Contributor

📚 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

@endiliey
Copy link
Contributor

In v1 we don't really use prismjs themes. It's a default prismjs css with hljs theme.

Understand that it's kinda weird, but had to do it because we want to support both syntax highlighting at v1 back then. The theme files might clash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants