Your software to me seems it would work very well regarding code snippets if you had syntax highlighting and some hookups to editors like textmate.
There is alot of really bad snippet apps on osx winning awards not because they even come close to DT but because they store snippets copying how you do it but with about 0.000001% of the features and slow (XML or SQLite storage). But the features they have like code highlighting are essentials you lack. They are all hacked up by bedroom guys…yet you have all this here already and just need to add in some of the things that would make it more comfortable to be used like this.
I have tried it sorry DT makes a only just passable snippet manager but with so little it could make a great snippet manager. Or even an off shoot version.
It would be nice to use the same app for docs, diagrams, media and code snippets but plain text snippets without hook up to to textmate are a bit boring.
Just an idea…checkout the snippet apps and you will see the features and how those in DT would make the ULTIMATE snippet manager on OSX.
I am very interested in this. DT would be amazing as a snippet manager with its super powerful search features. I wonder how well the AI would work with it.
Reviving an old thread. Now that I’m using DTPO for pretty much everything, a code syntax-highlighting feature would be very much welcome. It would be great it this could be implemented in MD documents and not as a separate “code document” format, so that one could include text and code in the same document (similar to what Quiver does, happenapps.com/)
@altostratus:
You already can do this. Lea Verou’s prism.js can be installed locally and linked to in the Markdown. I write long Markdown documents in DEVONthink every day, including sections of code and this works a treat for me.
Yes, it would be nice. I downloaded both the CSS and JS versions and couldn’t figure out how to attach them to a MD note (the “Script” field apparently only concerns AppleScript).
Quite simply, you put prism.css and prism.js in a directory and use this at the top of the document…
<link href="styles/prism.css" rel="stylesheet">
<script src="styles/prism.js"></script>
```…noting I put them in a [b]styles[/b] group along side my Markdown document.
Note: You can put this inline or in Markdown metadata [b]html header:[/b] at the very top of the Markdown document.
Then you just use a fenced code block with [b]language-XXXX[/b] in the first line [i](immediately after the three back-ticks)[/i], where XXXX is the language in lowercase. For example…
tell application id "DNtp"
-- do stuff
end tell
You can make your own Markdown template with this already in place for reuse. I have done this and have been using this template daily since the end of November. It works a treat (though I made some slight style changes to the CSS to fit my overall theme :smiley: )!
Thanks for the info. I can’t get it to work for some reason though. On the Prism download page, I unticked Javascript and ticked C#. I downloaded both CSS & JS and put them on the same level of my MD file (not in a “styles” folder). Then I added this at the top of the file:
Just thought I’d mention that, unfortunately, doing this results in a totally blank note displayed on iOS. When you edit it everything is there (and the note shows up in search results), but IMHO iOS should at least be able to show the note content in the default manner (i.e. code blocks as fixed-width text).
Do you think you could share your template script or create one we could use to add the header information to a Markdown document? Sorry, not very good with this type of scripting. If not that’s fine, just wanted to see.
One other question, do you duplicate the prism.css and prism.js to a new directory or do you replicate it so that if you make a change in the original file, it will take place across the different directories?