mdr
mdr copied to clipboard
Monitor mode
It is quite common for people to want to preview the result as they edit a document. This could be done by having e.g. two terminal windows side by side, one with the editor and the other with mdr running. mdr would need to monitor the file for change.
- That could be enabled with a
--monitorflag (or something else if there is already something commonly used in other software that I am not aware of) and we probably don’t want mdr to be in this mode by default. - Scroll position needs to stay the same across reloads.
- If for some reason the file is broken on reload (e.g. it was deleted, or it is breaking the markdown parser in any way) then it would be better to keep the previous state displayed (but maybe display a warning so authors know what’s up.
Make sense to me. --watch maybe ?
--watch sounds good. No idea if anything else uses it, but it works for me.
Optionally, a hotkey for explicit reloading of currently rendered file would be nice, when the program isn't running with monitor mode on.