I love org-mode with emacs. I use it to organize my notes / game hacks / todo / pretty much anything using a tree structure. You can use drawers to hide things like sample code.
(for making it more usable, see: https://babbagefiles.xyz/termux-extra-keys-emacs-org-roam-no... )