generally I use markdown for writting down… everything. This works great and can handle most of my data, but sometimes I need to have some calculations with notes and those may change as I go on. In Emacs there is Org-Mode capable of exactly this. What I’m looking for is a way to have an interpreter within Markdown, so I don’t have to use excel for short calculations and keep them beside the md files.
The closest thing that I can think of is Cantor, which is a great way to have multiple types of inputs within the same file but those are code first and markdown second, not to mention it cannot be opened with anything else. The cantor format is a zip file (not great), the jupyter notebook contains a lot of metadata (unsurprisingly). The python script file keeps the inputs and no clutter, but the markdown will not be interpreted and the outputs are lost.
Org-Mode had this figured out, but it was clunky (and nothing else beside Emacs speeks it). What I have in mind is a markdown file with input code blocks with a tag, and under it the output blocks could go, connecting them through the tags.
It is quite specific but do you have anything similar to this setup? How do you solve such problems (if you have such)?
But! I think it is possible to use external tools in Kate. So what is needed is to write a short python script that parses the markdown file, finds the executable code-blocks based on some extra hints (e.g. start every executable code-block with a comment string: #EXEC), evaluate them, and pastes the output into a new code block below the original or put it into another one if already present. Also it may be possible to use the current cursor position to evaluate only a single code block.
I guess there are TONS of ways it could/would fail, yet it seems like a great weekend project when I find the time.
You should look into installing Marksman. It’s a language server that Kate can leverage so you can ctrl+click on links to other files, etc.
Then, if you want code blocks to be runnable, like math equations such as 3+3*9 and then paste you the results, you could write a python script that takes the equation as an argument. In Kate, you can then add it as external tool and give it a shortcut, then use any highlighted text as the argument for the python script. I used to do that for link parsing.
Edit: Nowadays I use Qownnotes, that has “solve equation” button in selection context menu. I haven’t really used it, but might be something you are interested in.