I have used both Carsten's and Eric's
solution, as well as
hideshow-org (
https://github.com/secelis/hideshow-org), which works
rather well and deserves a mention.
Expanding a bit on Carsten's post: Tassilo Horn wrote some convenience
functions to set the outline minor mode regexps to correspond to the
current comment syntax. Thus, if I'm (for instance) in shell-script
mode, # * and # ** become the outline level 1 and 2 markers.
This is great info! I was just looking for this in the last couple of
days and appreciate everyone's code since it's way beyond my elisp
abilities.