12
┌── ln(1) link, ln -- make links
│   ┌── Create a symbolic link.
│   │                         ┌── the optional path to the intended symlink
│   │                         │   if omitted, symlink is in . named as destination
│   │                         │   can use . or ~ or other relative paths
│   │                   ┌─────┴────────┐
ln -s /path/to/original /path/to/symlink
      └───────┬───────┘
              └── the path to the original file/folder
                  can use . or ~ or other relative paths

Found this useful method to explain Linux Commands, but have no idea how @grg did it. Manually is very time consuming. Is there a tool to do stuff like this?

Source: How can I create a symbolic link in Terminal?

3 Answers3

23

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

By customising PressAndHold.app 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 -->
<key>Roman-Accent-f</key>
<dict>
  <key>Direction</key>
  <string>right</string>
  <key>Keycaps</key>
  <string>─ │ ┌ ┐ └ ┘ ├ ┬ ┤ ┴ ┼</string>
  <key>Strings</key>
  <string>─ │ ┌ ┐ └ ┘ ├ ┬ ┤ ┴ ┼</string>
</dict>

grg
  • 201,078
  • Worked like a charm! After disabling SIP on my MacOS Mojave in recovery mode, I was able to edit the Keyboard-en.plist file. Simply copied the string tags and replaced those with the keybinding for "z" and worked ! Thanks a lot man. It will help a lot more people from now on. You are a gem! :) – Hardeep Singh Jul 25 '18 at 23:09
  • 1
    <string>─ │ ┌ ┐ └ ┘ ├ ┬ ┤ ┴ ┼</string> shows 11 box-drawing characters however, the picture of the PressAndHold.app interface only shows 9 of them. How do you access the last two, 10 and 11 ? – user3439894 Jul 26 '18 at 13:43
  • @user3439894

    By clicking the down arrow on the tooltip.

    First 9: https://i.imgur.com/SK6I47e.png

    After Clicking down arrow Last 2: https://i.imgur.com/yM5xoRC.png

    – Hardeep Singh Jul 26 '18 at 17:12
  • 1
    @Hardeep Singh, thanks for the information! It would have been nice if the original answer had included such important information. – user3439894 Jul 26 '18 at 18:08
  • 1
    @user3439894 I cut it out of my screenshot because the page switcher is only in Mojave (High Sierra should just show all the keys in a line) and because the current button in Mojave looks wrong (a beta bug I’m sure will be rectified). – grg Jul 26 '18 at 18:10
  • @grg Right. It looks like a bug. Totally out of the body. Reported it. Would love to it all in one line. on TouchBar too. – Hardeep Singh Jul 26 '18 at 20:52
  • @grg, Thanks for the explanation and such a good answer that certainly has some nice custom uses. +1 – user3439894 Jul 26 '18 at 21:45
7

You likely want to use asciiflow.com

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

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

  • 1
    Welcome to AD! Just as a helpful observation, you're answer is likely to garner increased interest if you explain how the solution you propose answers the question. – Allan Jul 25 '18 at 14:17
  • ASCII Flow looks good. I found out that the solution provided by @JBis is much convenient and I have more control over the character sets where as in ASCII flow I can only use hyphens and "+" symbols. – Hardeep Singh Jul 25 '18 at 16:36
3

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

Kiwy
  • 130