0

I am trying to:

  • form an ASCII art directory structure (similar to this fastlane snippet) in markdown (specifically on github comments). But it has to have hyperlinks in it, so, the usual `verbatim` will not work. ∴ I am looking for some way to format normal markdown text in the monospace font-family and give explicit spaces and explicit line breaks to preserve the structure.

I have found solutions for:

  • monospace: the html tag teletype tt or code works
  • explicit space: the non-breaking space &nbps; seems good alternate
    • to insert it directly as  : use alt + 255 on windows
    • for records: 	 doesn't work

Remains:

  • how to elegantly give explicit line breaks
  • (any other solution/advice/suggestion is welcome too)

Where do I stand:

  • Using <tt>...</tt> per line works in preserving line breaks, but due to the inherent inline nature it doesnt render good
  • Using <tt>...</tt> at block level (similar to recommended usage of details tag) gives a super awesome rendering, but doesnt provide any way to insert single line breaks (i think t's called soft break?) ...
  • ... none work among these: / <enter> ; <br/> ; &NewLine; ; &#13;&#10; (CRLF). I found these via Whitespace_character article referred in mailtrap blog on nbsp; and this SO answer
  • ... 2 <enters> provides 2 line breaks in render too

Render Preview Screenshot

Sources of trials:

<tt>/</tt>
<tt>├── fastlane</tt>
<tt>└── fastlane</tt>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;├── [changelog]</tt>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├ ...</tt>
<tt>&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├ ...</tt>

[changelog]: https://example.com
<tt>

/

├── fastlane \
└── fastlane <br/>
&nbsp;&nbsp;&nbsp;&nbsp;├── [changelog] &NewLine;
&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├ ... &#13;&#10;
&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├ ...

&nbsp;&nbsp;&nbsp;&nbsp;│&nbsp;&nbsp;&nbsp;├ ...

</tt>

[changelog]: https://example.com

Addendum:

  • i tried, and the `
    ` works in the vscodium's markdown preview. so, the issue is with github or other things not supporting this combination of these tags in markdown.
    – user8395964 Aug 21 '22 at 18:41

0 Answers0