Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Interesting, when I saw the headline, I immediately thought it was something else that I want: I keep all of my notes as plain-text Markdown files, and I use Wiki-style links between them, like `[Another File](another-file.md)`. One of the pitfalls of this approach is that if you change a filename, then all the links referencing that file will then be broken. So I'd love a tool like this that can be used to clean up a directory full of these documents.


I used to do that, but I switched to wiki-style [[links]] instead. But I can go back and forth with a regex.

There's some really interesting discussion about interlinked notes here: https://news.ycombinator.com/item?id=22767658


Love to hear any more commentary about the pros and cons of this approach? I assume the main reasoning is that it’s easier to make a link?

The nice thing about the `[File](file.md)` method is that it’s markdown native, e.g., you can follow them in GitHub, if you have a way to render file URLs HTML, you’re links will just work in the browser too, and many txt editors can follow them by default.


The only time I would use the `[File](file.md)` syntax is if I'm specifically making documentation that will be published for other people.

Also, Github uses Gollum, which actually supports wiki style links anyway.

If you are maintaining a knowledge base, it gets really tedious to do that, if 99% of your links are just going to have the same caption as your filename. So being able to make links as quickly as possible facilitates efficiency. Besides, there are alternative syntaxes for being able to specific a custom caption for a wiki-style link.

Another thing to consider, is that in most mediums that I use my knowledge bases in, they are not styling my links anyway. I can still of course follow them automatically, but they are just presenting them as [[Links]]. Most people prefer that.

My different wikis have gone through many different iterations, and most of these engines are fairly compatible-ish with each other. They are similar enough that any migration required could be done with a few lines of Perl on my set of md files.


Huh, ok I just tried this out and it doesn't work as well as I was hoping. It appears that that `[[A file]]` style works on GitHub Wikis but doesn't work in the repo browser itself (e.g., from the `README.md`)? That's a major limitation to me, because one of the big benefits of my approach is I get a free web version of every local Wiki that I have on GitHub.

I'm curious if you have another solution for actually publishing a `git` repo on the web using the `[[a file]]` link style?


Oh sorry, if you want it to work in your README.md, you have to specify the org-mode syntax. BTW it supporst org-mode syntax. Just have a README.org.


Nice, lots of great tips here, you've made a strong enough case that I’m going to try out this approach myself. Thanks for sharing!


Given that your file names are pretty unique words, does it really need to be harder than a simple search-and-replace?

sed -i 's/(another-file\.md)/(yet-another-file.md)/g' *.md


It could be automatic. I also do everything as .md and have been contemplating this for a while. Maybe I should get it done finaly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: