Obsidian and link support
There's an interesting open-source project called Obsidian that allows users to create a kind of personal wiki based on a simple directory of Markdown files.
To allow linking between different files, Obsidian uses a syntax that looks like [[foo]]
(for links within a document) and ![[foo]]
for links to other documents.
Even if it's not possible to extend Marked 2 to handle linking, it might be nice if the Marked 2 renderer could present Obsidian links in a slightly more attractive way (currently, they're simply rendered as literal text).
Obsidian does include its own preview renderer for Markdown, but Marked 2's rendering is more attractive, so sometimes it might be nice to be able to read Obsidian documents using Marked 2.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Brett on 21 Feb, 2021 01:11 PM
Hi Angus,
Marked does not function well as a wiki, but it's entirely possible to extend it to recognize the link syntax using custom preprocessors. It's unlikely I'll make the additional syntax part of the core installation, though.
nvUltra, my upcoming notes app, also recognizes Wiki links, as does nvALT before it. But they make sense in apps like that which can handle them internally. Marked would never know for sure what to do with them. Add an MD extension? Assume a rendered HTML file? Is the target relative to the document? What if we're in a streaming preview without base url? Too many inconsistencies between implementations to make any assumptions.
As I mentioned, though, a few lines in a custom preprocessor script could not only make them look better, but render them to link in just the way you expect them to. If I find time, I'll write one up, but if you have any scripting knowledge, it's just a simple regex replacement.
- Brett
2 Posted by Maz on 22 Apr, 2021 04:54 AM
"Obsidian does include its own preview renderer for Markdown, but Marked 2's rendering is more attractive, so sometimes it might be nice to be able to read Obsidian documents using Marked 2." Strongly second that, and request to create a simple solution to stream from obsidian to Marked 2,( for those not into coding :))
Support Staff 3 Posted by Brett on 23 Apr, 2021 02:15 PM
A streaming solution from Obsidian to Marked would have to be implemented on the Obsidian side. It's easy to set up, but requires that the developer of the source app add it: https://marked2app.com/help/Streaming_Preview
I would point out a great Keyboard Maestro macro from Bruno Conte that I'll be writing about on my blog soon, but if you're a KM user, feel free to try it out.
Keyboard Maestro: Copy And Stream to Marked
4 Posted by Angus McIntyre on 28 Apr, 2021 01:58 AM
Having learned from Brett's post that pre-processors were an option in Marked (I should really read the manual), I did a little playing around. The following trivial Python3 script doesn't add any hyperlinking functionality, but it makes the output look a little nicer.
Save it somewhere, make it executable, and then set it up as a custom preprocessor through the Advanced tab in Preferences.
Support Staff 5 Posted by Brett on 28 Apr, 2021 12:06 PM
Nicely done @Angus.