Hello, the footnote will be [^fn1] when I compile my project to markdown. However, I’d like to change them to [^注1] as a Chinese version. I’ve tried to find the solution but failed. What should I do?
fn
is just a temporary arbitrary label, it does not display in the final converted file. If you still need to have fn as 注 then you can use a simple post-processing compile script that does a search replace to replace [^fn
with [^注
— I can write that if it will help you.
Thanks, I will try the post-process script. Actually, I export as md, and in typora it shows fn, so I must change it.
This unfortunately will not be of direct help to you, unless you use Cygwin, but I figured I’d drop a link to this write-up on how to insert sed into the processing pipeline so that quick little patches like this can be done to the output during compile. Anyone else coming through this thread might benefit.
For Windows, there may be some other basic text processing tool like sed, but I am not very familiar with anything other than Linux and Mac.
I’ve tried Python and it works.
There are some nice alternatives to sed
too, like sd
whose syntax is cleaner and less crufty:
Available cross-platform in most package managers. As an even more off-topic aside, I totally love this new shell bootstrap interface called x-cmd that works across Linux, macOS, Raspberry Pi and Windows:
…it provides a great unified discovery interface for lots of “improved” shell tools and packages many of them in its own package manager (including sd
: x env use sd
).
Nice, I’ll have to check these out. I’ve been switching over to ag (Silver Searcher) from grep for a bit now. It’s comfortable in that most of its flags match grep, so you don’t lose that muscle memory, but it’s so much faster when trawling large directory hierarchies, and the output is clearer. It’s nice to see innovation in these areas that you tend to think of as fossilised for the past 40+ years.