I write down all my commands, ever issued in the terminal, in temporal ordered markdown files per task/project. This means I can go back, compare, see how I did it in the past and improve, if possible. Or investigate, why something isn't working (based on my noted commands, which is eaier in hindsight).
Not sure I understand the question - I use code-blocks (```ls -alh```) or inline code (`ls -alh`). Everything else is comments and descriptions, what I am doing here. I don't really need rendering, most of the time I use Notepad++, or Typora, or my own Gitlab, or the markdown-text app in my nextcloud.
Maybe I do understand: I usually work from Windows, because I prefer the "frontend" over linux. However, all my work I do in WSL. Which allows me having multiple terminals open, multiple Linux OS etc. It is easy to copy&paste code. Perhaps it is not so easy doing everything with plain terminal in linux, e.g. vim, tmux (or, lets say, it requires a longer time to learn doing quick).