I hope Obsidian devs will implement a native feature to easily format our markdown notes for exporting and printing purposes. Right now, I use Marked 2.
The goal here is to load a preprocessor in Marked 2 with a regex turning:
I love [[Bakery MOC#Donuts|big fat donuts]]!
into:
I love big fat donuts!
Step 1: Follow this tutorial.
Step 2: We modify the script from the tutorial.
Instead of:
input.gsub!(/\[\[(.*?)\]\]/) do |m|
match = Regexp.last_match
link_target = match[1]
"\[\[[#{link_target}](thearchive://match/#{URI.escape(link_target)})\]\]"
end
print input
Write:
input.gsub!(/\[\[[^\]\[]*\|(.*?)\]\]/, '\1')
print input