This is a small personal project to extend the functionality of markdown.
I would like to write the compiler in Rust.
It would take a file from a format, like text.cd and compile it straight to text.md.
The text.cd file would contain raw markdown and variables sprinkled throughout that
could be referenced later throughout the file.
For example:
This is a line of markdown
@#var_name = this holds markdown information
or
@#var_tex = $$This is a KaTeX math equation$$
...
var_name output: @var_name
var_tex output: @var_tex
This is gonna take some knowledge of how compilers work. A bit of parsing knowledge as well. We may even be able to use flex for this 🤷. May be more fun to write it ourselves tho.
I take notes with markdown and render them using vscode's renderer. vscode's renderer supports inline KaTeX and having a way to shortcut parts or entirety of equations would be nice
Rust is fast and fun (in my opinion) to program in. It has a learning curve tho so don't be hesitant to ask questions.
We will probably read the file in a string and run the operations on it like that. This "compiler" might just be one big string manipulation program lol.
I wonder if basic editor markdown highlighting could be used for .cd files.
If not, this would mean creating our own language server so it looks nice in the
editor.