3
5 Comments

Syntax Highlighter for Dev blog

I'm looking for a good code block formatter that does syntax highlighting on Ghost blog. Does anyone have any good options?

I've tried prism but the colors look too generic.

on March 11, 2022
  1. 1

    I use Prism on both my blog and for a book I recently published and have been really pleased with its power and flexibility — since you aren't happy with the default themes you might check https://github.com/PrismJS/prism-themes for additional themes.

    There's also a newer, JS-free option that looks really interesting: https://torchlight.dev

    If I ever decide to make a major update to my blog, I'll probably give Torchlight a serious look.

    1. 1

      Fantastic, the prism-themes are much much better!

      Man the torchlight dev with line highlighting is really cool but I prob can't use it with Ghost.

  2. 1

    I've used HighlightJS on any blog that requires syntax highlighting and love it: https://highlightjs.org/

    • Supports pretty much any language
    • Easily extensible
    • Themeable

    Our blog, https://serversideup.net/ uses it for all of our code. Should work with Ghost as well. Hope this helps!

    1. 1

      ooo that's a good alternative too. Thank you so much for the suggestion!

    2. 1

      That looks fantastic! It’s a shame they charge $14/month for only 5000 visits, though. Really breaks for dev blogs that aren’t more commercialized than an occasional affiliate link.