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

[MINOR] Does any theme support code highlighting? #159

Open
jason--liu opened this issue Nov 18, 2021 · 4 comments
Open

[MINOR] Does any theme support code highlighting? #159

jason--liu opened this issue Nov 18, 2021 · 4 comments
Labels
minor feature Feature request inline with current graphing capabilites

Comments

@jason--liu
Copy link

jason--liu commented Nov 18, 2021

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 jason--liu added the minor feature Feature request inline with current graphing capabilites label Nov 18, 2021
@tefkah
Copy link
Contributor

tefkah commented Nov 18, 2021

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 tefkah added this to Planned (minor) in Org Roam UI features via automation Nov 18, 2021
@tefkah
Copy link
Contributor

tefkah commented Nov 18, 2021

Prism actually does support elisp, great!

@rasendubi
Copy link
Contributor

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 😕)

@tefkah
Copy link
Contributor

tefkah commented Dec 4, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor feature Feature request inline with current graphing capabilites
Projects
Org Roam UI features
  
Selected for Development
Development

No branches or pull requests

3 participants