valeriangalliat / markdown-it-highlightjs

Preset to use highlight.js with markdown-it.
The Unlicense
54 stars 30 forks source link

How can I use a custom theme with the preset? #31

Open sabaimran opened 3 weeks ago

sabaimran commented 3 weeks ago

Hi! Thanks so much for making and maintaining this package. How can I use a custom theme with the package in a node project?

import markdownIt from 'markdown-it';
import mditHljs from "markdown-it-highlightjs";

const md = new markdownIt({
    html: true,
    linkify: true,
    typographer: true
});

md.use(mditHljs, {
    inline: true,
    code: true
});

This is roughly what I have right now. It loads up the default theme, but I'd love to use something custom. Is the recommended way to do that just to use include a custom stylesheet, like from here, and maybe manually change the DOM references?

valeriangalliat commented 3 weeks ago

Hi! Yeah in my experience customizing the theme is done by switching the stylesheet :) I'm not aware of there being any markup change between different themes