How to enable Prism on DT 3.5?

The header section that calls the files has open/close quotes, probably from copy/paste. Retype them to replace them with the general quote that look like this " "

instead of this “ ”

1 Like

That did the trick. Thank you very much! This will really help me organize my work notes. :smile:

Thanks for this.
What is your capture flow?
I wonder how to effectively capture, especially on the IOS (is there a way to create the necessarily boilerplate per shortcut maybe?).
This old discussion suggested to use a service on mac. Is it how you guys use this with prism support?

You may want to start a new thread on how to capture snippets on iOS. I’m mostly on the Mac but if I were on iOS I would look at Text Replacement to expand the prism header on typing a keyword: Look in General > Keyboard > Text Replacement.

Good idea. I used KM to do same for the MAC now. But i really wonder if there is a way to select text on IOS and then use some magic to bake it into a proper md note with prism support directly in DTTG. This would open a way to sync this later with e.g. Anki specifically for code snippets.

@jasonekratz I like your idea.

I have used a local copy of JavaScript and CSS files that I linked into markdown. It is not my preferred solution.

Providing a way for users to add their JavaScript and CSS files to the Application Support folder would be better because it would not require us to alter existing and new documents with links to custom files. Some of us have many existing markdown files and hope to have many more.

The ideal solution would be to have a file in the Application Support folder that is always included when a markdown file is rendered by DEVONthink. The file could be empty by default and thus would not alter behavior unless action was taken by the user. A user could include links in that file to their own prism.js and prism.css. Those custom prism files could reside in this same location in Application Support as the include file. This would permit the customizations to persist over upgrades (much like they would if they were stored in a DEVONthink database). It would also permit us to share the markdown rendering across many DEVONthink databases since the files are equally available to all the open DEVONthink databases. This would also allow users to include other files beyond prism. Who knows what kind of amazing customizations users could include in their markdown files?

The key for me, for this include file suggestion, is being able to change the rendering of my markdown files without having to alter the sources.

2 Likes

See here Prism with iOS Siri Shortcuts

Thank you for sharing @MosCool_Noel

Do you have the idea how to see PRISM preview of eg. Python snippet in colors after clicking a file with spacebar?

At the moment it works perfectly in a preview of already opened file. But it would be nice to see a rendered text just in a quick preview with spacebar…

Many thanks in advance :slight_smile:
Andy

No this will not work. Apple’s QuickLook plugin, used when you press the Spacebar, doesn’t support it.

Thanks.

Once upon a time I’ve installed:


but it didn’t work… Installation seemed to be OK, but QuickLook didn’t show me a color syntax.

Andy

1 Like

Precisely speaking:

  1. Highlight:
    http://www.andre-simon.de/doku/highlight/en/highlight.php
    works
  2. … but the QLColorCode QL plugin doesn’t

Andy

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.