Snippets

Thank you, didn’t realize that was there.

That’s a personal preference. For one, I rarely ever replicate files. (30+ years in graphic design and prepress has given me very compartmentalized directory structures and thinking :smiley: ). Two, also due to my inclinations, I duplicate them but it’s part of an ongoing, evolving process I’m working out daily. Your call.

It’s been 8 years since the OP!
Any chance this finally be a builtin feature and not a “hack” involving downloading 3rd party files? I would love to have this feature in DT, so I can get rid of yet another app and spend more time in DT.

PS: prism.js IS pretty cool, but still would like “out-of-the-box” experience.

No, syntax highlighting in Markdown documents is not supported. Prism.js (or the framework of your choice) is still the best option.

OK, maybe in the future versions ))
Anyway, prism.js works fine, but for some reason once I format an MD document accordingly (with prism’s ref’s) and save it, then later I can not edit this document inside DT. I have to open in BBEdit for editing.
Also I tried importing a few MD notes from BearApp and I also can not edit them in DT.
Is this by design or I’m doing something wrong?

Just want to add my voice to the group using DT for code snippets. In my case using it for configuration, secrets (like API keys) and other bits & pieces to keep a small community-oriented set of software working smoothly while also managing the knowledge needed around community priorities and needs. Nice to have it all in one app!

1 Like

Quitting and relaunching seems to have fixed it.

Is this “fix” of relaunching DT3 related to the annoying web engine bug that CSS seems to get cached beyond file change? (see Markdown soo much better now, but still issues)

Would be great if this get fixed! (If I remember correctly, this is an Apple bug, not a DT bug…)

Did this thread really get 1,700 views in 21 minutes? How can that be?

+1

@rkaplan it started in

2019-12-13_10-46-10

:slight_smile:

I tried and it is also possible to insert DEVONthink links (“x-devonthink-item://”) that refer to the css and javascript documents instead of duplicating them everywhere.

Just wondering if soft wrapping is possible when using prism for fenced code block?

Thank you

Need another plug in such as this?
https://prismjs.com/plugins/line-numbers/

Go into prism.css and change:
white-space: pre;
to
white-space: pre-wrap;.

1 Like

Thank you very much!

You’re welcome :slight_smile:

+1 to have it DT

@ngan i have been trying to get the line numbering to work but have no clue how to, do you use it and if so how to you activate in in your css?

thx

Z

No I don’t use line numbering.

@bluefrog is the man…

BTW, I used to add prism.js and prism.css to every group that uses fenced code block but just found out that the header of markdown file can reference to the path of the StyleSheets directly. Hope this info will be useful for other beginners of markdown like me.

<link rel="stylesheet" href="/Users/user name/Library/Application Support/DEVONthink 3/StyleSheets/prism.css">
<script src="/Users/user name/Library/Application Support/DEVONthink 3/StyleSheets/prism.js"></script>

hmm interesting you mean to the css file i use in devonthink? Can you give an example on how you incorporate that into your css? Do you just paste the above 2 lines anywhere there or is there a specific location?

thx

Z

(1) The prism.css and prism.js are in the macOS folder “StyleSheets” of DT.
(2) Just paste the two lines in the md file that you need fenced code block.

If you have TextExpander or BTT or KM or any similar apps, you can just paste the two lines and quotes and even the clipboard content to a blank md file.

My TE setup allows me to copy the codes first, then I type the TE shortcut in a blank md file and everything needed is in. But the fenced code will only be viewable when the file is located in your computer (DT or some editors) because the reference path is pointing to local files.