In short: I believe there isnât a way to do this, and for self-evident reasons. Letâs peel back a few (mis-)conceptions so as to address the problem:
- there is no such thing as a ziplink, in terms of a link that can be addressed. The âziplinkâ method of making links simple makes Tinderbox text links.
- Tinderbox text links are not exported in Markdown form, but as HTML. I suspect this is because Markdown is only a proxy for HTMl, that Tinderbox exports flawlessly.
So, the question becomes, how do I export a Tinderbox text link in Markdown mark-up , and not as an HTML link? In short I donât think you can.
To the bemusement of those who only use Markdown, it is only a âliteâ method of marking up (a subset) of HTML. Tinderbox can export a note that contains Markdown mark-up as valid HTML. However, I donât think there is a method to tell Tinderbox to process $Text and replace text links with Markdown. (there all sorts of good reasons I can see , to do with calculating the exported HTML filename, etc.).
This isnât to say what you want is wrong, but the disconnect is in assuming Tinderbox is an Markdown-based app. It isnât, but for the legitimate reason that Markdown post-dates Tinderbox by some years and the whole PKM genre of Markdown-centric wikis came a lot later.
If you want notes to export as Markdown, my hunch is that is a feature request. But, unless youâve a dislike of actual HTML in MD files you should be fine. Donât forget to look at the âExportâ tab and not just the âPreviewâ tab.
I suspect you meant to write âthere is NO such thing as a Ziplinkâ.
I appreciate that this is an old post, but as an aspiring Tinderbox user, I have a similar question.
Has there been any work to support exporting basic links as HTML when using a Markdown preprocessor?
FWIW, Iâm contemplating writing an export post processor that analyzes each exported HTML page and adds back in their basic links.
Using basic links is somewhat important to me because I would like to use the Links browser in notes and use basic links to visualize connections between my notes. I canât seem to do that when using Markdown links that utilizes template code to render links to notes.
Thanks in advance for your help and thoughts!
What do you mean by basic links? I write 100% of my links in markdown and export them just fine.
As for showing the connection between notes, I donât rely on the ziplink method for connecting inline text to another note; I find it very limited. Rather, Iâve written an action code that links my notes by pulling values from attributes or Iâll use the link parking lot. I can then use the Links Pane to navigate these notes, leverage hyperbolic view, etc. This is the more scalable route to go.
Iâve/weâve made several videos on linking: Mastering Tinderbox: Training Videos (Complete List). If you show up at one of the weekly meetup we can also go through it again live. Or, if you canât make it please outline the project youâre working on and I can make something up.
Specifically, as you suggested, I think the links I want to imbed and export in my Markdown notes are referred to as âZiplinks.â These inter-Tinderbox links do not get rendered when using a Markdown preprocessor it seems.
Iâm curious, how do you make Markdown links to other notes in your Tinderbox notes?
I might be wrong, but one of the advantages of using Ziplinks is that it creates outbound links to other notes and allows one to click into other notes when in edit mode. It also provides an easy way for incrementally searching for the note to which you want to link.
I watched a few of the meetups this weekend and they are excellent. Tinderbox has wonderfully supportive community supporting it!
To understand links better, see Links. In Tinderbox terms a âBasicâ link is a link between notes, whereas a âTextâ like is a note starting with (and less commonly ending at) anchor text within the text ($Text) of a note. The latter will be more familiar to those whose understanding of linking comes from use of the Web and HTML.
There is no âziplinkâ as such, in that zip-liking is just one method for making Text links (q.v. above). IOW, once generated, a âzipâ link is indistinguishable for a Text link.
Iâm less clear on the Markdown part as I donât use it in my own work. Could you post a small example TBX file with some linking and explain what you expect vs what you actually get?
I have to be very brief here.
The natural way to use Tinderbox â and the way you should reach for first â is to use Tinderboxâs excellent text facilities, HTML export, and text links.
Markdown support is an inferior alternative, provided chiefly for (a) very fast writing in lectures and such, and (b) a transition path for those accustomed to Markdown, especially people new to macOS.
I agree with this statement, especially if youâre looking to create interaction and linking between notes.
For those out there, one thing to consider is that sometimes you may need to preview a note first before the text link navigation will work. Why is this? Previewing a note exports the note to the hard drive; when you click on the text link, the preview browser can follow the path to the exported note. If the note has not been previously previewed, there is no note to go to. So, youâre left clicking the link in the preview, and nothing happens. Now you know what might be causing this and what to do about it. Note: you may not experience all the time, Iâm not been able to exactly reproduce when this may happen or not.
I feel like this statement may put an unnecessary pale on markdown. I think it all depends on the context. I agree, if you are looking to create links to now within a TBX file, text links are the way to go. However, if you use external links in your notes, personally, I find markdown to be a fabulous option (NOTE: to make it work, you need to populate $HTMLPreviewCommand with CommonMark or Markdown.
Here is why I say this: You can hyperlink text to an external link using â+K, but this puts the link the RTF and does not make it that accessible. If you use markdown, you can write like like this [Identity Praxis](www.identitypraxis.com)
, e.g., Identity Praxis. Using this method lets you edit links, stream parse the text, etc. I find that it gives me a LOT more flexilbity and control over my writing,
It turns out that in my testing with Markdown notes I was linking to a note that was not set to export, so the linksâquite rightlyâwere not rendering in the export and preview tabs
However, I think I found a bug in how internal text links (i.e. links to other notes) are outputted to the Markdown export command. For example, if I link to a note in the root of my Tinderbox documentâs outline, itâll be rendered using an absolute path (i.e. prepended with a forward â/â slash.) This breaks the HTML export and preview links as they should be relative to the current note. To fix this bug, I wrote a little action code that removes the forward slash in the exported noteâs âhrefâ attribute. This function is called in the default âPreviewâ template:
// Fixes a bug in Tinderbox's Markdown link implementation
// where internal links are outputted as absolute instead of
// relative to the current note.
//
// Fortunately, we just need to remove the leading forward slash
// (/) from the links.
function fixInternalLinks(aNote) {
// Note that when usisng Pandoc as an $HTMLExportCommand or
// $HTMLPreviewCommand, it breaks across lines so it might be
// advisale to use the `--wrap=preserve` parameter.
return exportedString(aNote, "^text^").replace('href="/', 'href="');
}
(Yes, I appriciate that my comments might be a bit verbose, but Iâm a forgetful sort.)
Anyway, Iâm very excited to start my journey with Tinderbox. Thank you all again for your support. Learning Tinderbox through this communityâs experiences has been a breath of fresh air. Thank you!
What are you referring to by âthe Markdown (sic) export commandâ? Thereâs no built-in markdown export command in the Edit menu. Markdown export is mainly a DIY effort.
Paul, thanks for chiming in.
Sorry, my previous statement may have been vague. I should have made it clear that when I said âexportâ I was referring to the command that takes a Markdown-formatted note and converts it to HTML, which, of course, can be previewed in, and exported from, Tinderbox.
Specifically, I was referering to these two attributes, which are set on my âMarkdownâ Prototypeâyep, thatâs how Markdown is spelled:
$HTMLExportCommand
$HTMLPreviewCommand
In my case, Iâve set the âcommandâ to the path of my Pandoc binary, which was installed through Homebrew. I am not using the built-in Markdown
or CommandMark
Markdown pre-processor commands.
Chears!
This is (unintentionally) incorrect in two ways. Firstly, whist â+K will add a weblink to text in a draft post in the forum here (where posts use Markdown or explicit HTML for styling), doing that is a web-browser app feature: it works in Safari and probably other web browsers. Secondly, to add a weblink to a noteâs $Text you can:
- select some $Text as the linkâs anchor text, then use â+â„+â+L or Note menu â Make Web link and add a URL to generate the web link
- paste in text, e.g. copied from a web page or RTF source, that contains a web link. In this case Tinderbox will detect the link and adopt it as a true Tinderbox Web link.
- (at one point the latter didnât happenâand this is the likely cause of @satikusalaâs confusionâbut it does work now, certainly in v10.
I think @eastgateâs point is correct and fair. Tinderbox, and HTML, predate Markdown by some years and Tinderbox does not need Markdown to function normally. Indeed, most users have no need of Markdown to use the app successfully.
Some [sic] Markdown support was added because when Obsidian and Roam were getting a lot of notice there was an assumption by some users that all noting tools should âuseâ Markdown. In addition, because they first learned to make HTML using Markdown-based apps they may not understand (or wish to learn HTML). Thatâs fine, and those people are supported, but it is not Tinderboxâs norm.
In addition, some complex export scenarios requiring generating export necessary for the requirements of some other program, for instance pandoc may require use of Markdown within Tinderbox.
So Markdown is a niche use for Tinderbox as a whole, even if some users regularly use it and it their norm. Those wanting to use Markdown can, but it is not the norm for general use of Tinderbox, and the community suggesting otherwise is unhelpful to the new user. Use of Markdown, as a side case, needs some additional configuration before use.
When I write in Markdown in Tinderbox, I use the app Marked to Preview. In addition, not only can I preview my note, but if I want to export to pdf⊠then Marked has great export options as well.
Tom
Thanks for saying this, @mwra. For better or worse, Markdown-formatted note taking is essential to my workflow as there are a variety of âdonwstreamâ processes that Iâve developed that take Markdown as input. It would be non-trivial for me to change these aspects of my workflow to accept RTF or HTML instead.
Relative links are allowed by but not a requirement of HTML, which is what Markdown evaluation generates. Can you post (upload here) a small TBX document that shows the issue?
Indeed, and no one is suggesting you canât use Markdown. But, it is not Tinderbox norm. The latter fact should not be controversial.
Sure. Please see attached.
2024-09-11 TBX Markdown Example.tbx (252.4 KB)
No bug here but differing baseline assumptions. Tinderbox is passing correct $Path info to Markdown, but Markdown is unable to parse it correctly, i.e. because it doesnât expect a $Path to open with a /
. Both bundled Markdown scripts (âMarkdownâ and âCommonMarkâ) have this issue. it might be that other flavours of Markdown have less fixed assumptions (Iâm not an Markdown user)
I did wonder if the issue related only to links towards root-level notes, but it seems to affect all links. Your function seems to address things, at least for internal use
There is no right/wrong here. In an app designed around Markdown, likely an extra filter might be applied to path info passed to Markdown. That said, Iâd have expected this issue to have been raised before, so maybe an accommodation for Markdown has come loose.
Both Mark B and myself are at the Hypertext 2024 conference through Friday then travelling home so a deeper dive on this might have to wait a few days. Until then I suggest using your function but donât refer to it formally as a bug in Tinderbox (as opposed to Markdown) until we know that to be the case.
This could be addressed, though in the expected export scenarios, the path /Somewhere/Note is relative to the logical root of the server. So, this should work correctly for export, and should work correctly when using a local server.\