org-roam-ui icon indicating copy to clipboard operation
org-roam-ui copied to clipboard

[MINOR] Does any theme support code highlighting?

Open jason--liu opened this issue 3 years ago • 4 comments

I have tried almost every theme in org-roam-ui, but none of them can display code block properply. It would be more readable if code block support highlighting. My question is if there is a theme or setting can support code block highlighting(may be I missed something). If not, I think it would be a nice feature to support. Thank you.

jason--liu avatar Nov 18 '21 07:11 jason--liu

No not at the moment, sorry! Syntax highlighting is not that difficult to add, in fact the implementation is sort of there already, just commented out, but

  1. It's slow, and makes the application much larger, and
  2. Not all languages are supported, most importantly: elisp. There's probably a way to fake this by extending the lisp syntax.
  3. Need to implement the highlighting in the themes

Should all not be too difficult, but I hadn't gotten around to it due, I'll work on it!

tefkah avatar Nov 18 '21 08:11 tefkah

Prism actually does support elisp, great!

tefkah avatar Nov 18 '21 08:11 tefkah

FWIW, I use the following setup for my blog:

import prism from '@mapbox/rehype-prism';

const processor = unified()
  ...
  .use(prism, {
    ignoreMissing: true,
    alias: {
      lisp: 'common-lisp',
    },
  })
  ...

It works fine for me!

(reposted because email replies do not support markdown :confused:)

rasendubi avatar Nov 18 '21 12:11 rasendubi

Ah yes, that should work! I actually stole this tip for Emacs Docs, and then promptly forgot to implement this here. Will be added in a sec

tefkah avatar Dec 04 '21 09:12 tefkah