I need to organize all of my math notes. I would like to create a sort of library of notes, where a note can link other notes and each note is stored in plain text format (for example, Markdown + Katex/Mathjax) because I want to git track the whole thing.
Whatever the format, there should be an editor available with instant-preview. Also it should be easy to export individual notes or groups of note to publishable formats like PDF and HTML.
All the notes should be quickly searchable by keywords.
I don't need mobile support.
I am open to suggestions. I'm on Linux, but browser-based apps are welcome, as long as they can run offline.
Note: I recently posted Private local wiki for structured math journal?, which was specific to wiki. Here I am looking for alternatives not involving wiki.