Apple - How to create MacOS/*nix command explainer text like this using a tool?

That's my answer! I did it manually, but used (built into macOS) to speed up entering the box drawing characters. The text was abridged from the man page manually.

By customising keys, basically editing /System/L*/Inp*/Pr*/*/P*/*/*/R*/ to add box drawing characters, I can type the characters directly into the text field whether here on SE or elsewhere.

Add the following to your language's keyboard file within that folder, such as ‘Keyboard-en.plist’ for an English keyboard layout. Open the plist with a text editor to paste the XML below, or open with Xcode and manually create the dictionary, pasting values as necessary. Replace ‘f’ with the key you wish to use. You can then insert box drawing characters by holding down the key and then selecting a number, or if you have a Touch Bar the keys appear there too with High Sierra.

<!-- f: box drawing characters -->
  <string>─ │ ┌ ┐ └ ┘ ├ ┬ ┤ ┴ ┼</string>
  <string>─ │ ┌ ┐ └ ┘ ├ ┬ ┤ ┴ ┼</string>

You likely want to use

I can't really add anymore to this answer ;)

I've since found that the explaination text seems to be taken from

I know one site that does that and it is By the way I've just realize that explainShell code is available on GitHub:
I do not know how they technically end up doing that, but they are using an opensource project name "Show The Doc" available here: