How to enable Prism on DT 3.5?

Precisely speaking:

  1. Highlight:
  2. … but the QLColorCode QL plugin doesn’t


I’d see if the author of either piece can assist on this.

Thanks @MosCool_Noel. Thinking of moving to DevonThink and syntax highlighting’s a key requirement.

I ended up applying the GitHub2 style from MacDown in Media preferences and linking to the syntax highlighting style, as in this solution. This yields the correct output.

Hopefully Prism support will grow. Ultimately I’d like to see all languages enabled with options for line numbers and language names, similar to MacDown. A fully enabled Prism download’s only ~0.5 mb, seems like a very acceptable tradeoff for full language support.

Line Numbers
To get line numbers, just paste the above html after the prism html tags that search for the JS and CSS prim files.

Persistant Language Shown
If you want language names to show without hovering. Include the Show Language plugin in your prism files and in the CSS file set the opacity to 1 of the toolbar class. You can remove the transition effect. Be sure to Restart Devonthink.

I have added a proposal here

btw: lang-swift should also work

Is there any place to vote for full prism support? For me the most useful addition since markdown…

Here is fine. However, it’s not such a simple matter. As the number of languages increase, so does the overhead in any exports of the Markdown. Also, adding UI to the preferences to toggle the state of languages would be cumbersome and likely unsightly, especially given the number of languages Prism supports.

I see. I think I never exported much out of DT (and I also use Marked2 which has it’s own syntax highlighting). My notes have a ton of code snippets of all kind of languages. What kind of exports would this affect? Just HTML/Website export or others as well? Maybe an option between full, limited and no prism would be sufficient? With a short note about the consequences? But then, the solution by MosCool_Noel to have a custom install would also work fine for me.

HTML conversions would be affected.
Development could assess this request at their discretion.

1 Like