I’ve been using Prism in DEVONthink Markdown documents pretty much since I learned it was a thing. It seems to offer support for most of the languages I use, but it doesn’t seem to support C# or Rust (or maybe I don’t know the right language-qualifier term to use after the back-ticks). Does it support these languages already? If so, what are the right qualifiers? If not, could that be a feature request? Thanks!
This page may help you: https://prismjs.com/#supported-languages.
Stephen
Sorry, I probably should have been more clear. First, thank you for pointing out the list of supported languages, but I was aware of that and find both C# and Rust listed on that page. However, when I try to use the expected designators in DEVONthink (DT), they don’t produce syntax highlighting as other languages do. It’s my (possibly incorrect?) understanding that DT supports only a subset of the languages on that Prism support page. That’s why I’m asking the question here.
Apologies for not appreciating what you originally meant! You are correct in your understanding, I think. This is from page 43 of the excellent manual (also available through the in-app Help):
Note: Not all languages supported by Prism are available. Additional languages may be added in the future if there’s sufficient interest in them.
Stephen
That is correct. Not all languages are supported in DEVONthink. The request is noted with no promises.
I know this is old, but just in case anybody comes across it looking for the answer about Language X.
While the built-in prism doesn’t support all languages, you are able to create your own prism files and use them. After generating them from PrismJS you can import the CSS and JS files into your database and then add the links to the Markdown:
<link href="x-devonthink-item://DB8A0D35-1B24-4299-8559-B88DAAD14CF6" rel="stylesheet">
<script src="x-devonthink-item://A413626F-AB37-4465-8906-9216649B7D59"></script>
I usually capture everything in Drafts and then have Drafts add them automatically when it send the note to DEVONthink.
Thanks for the suggestion. I’m sure there are people who will find it very useful.
First, thanks for that tip. Second, could you maybe say something more about “…generating them from PrismJS” as I don’t know how to do that. It sounds like it might be exactly what I’m after.
https://prismjs.com/download.html
The download page is essentially a menu card offering a wide range of options – themes, languages and plugins. Mark those you want, download the resulting JavaScript and CSS files
For example I added the plugin Copy to Clipboard Button. Works just like in the code blocks here on Discourse and many other places.
Oh, ok, sorry, I did know how to do that from the web site. I thought you were talking about some other tool. Thanks again for the help to you and @BLUEFROG. I’ve done exactly that myself
Okay then It wasn’t really clear, not everyone knows.
What were you wondering? If there’s perhaps some way to generate the JS file in a way that doesn’t involve the download page? I’m not aware of any.
I think it’s been long enough since I messed with it that I thought he was talking about some external standalone tool or something that I didn’t know how to use. It probably doesn’t help that I have a cold and might be a touch loopy today as well.