tldr-pages / tldr-lint

:rotating_light: A linting tool to validate tldr pages
https://www.npmjs.com/package/tldr-lint
MIT License
37 stars 20 forks source link

Replace/Deprecate TLDR008 #93

Open SethFalco opened 3 years ago

SethFalco commented 3 years ago

Markdown files depend on trailing whitespace to add a line break without creating a new paragraph.

image

Due to our .editorconfig and TLDR008, we don't have 2 spaces between the description and more information link. This makes websites and other Markdown renderers render them on the same line.

For example, this issue occurs when viewing files on GitHub and on tldr.ostera.io.

I think TLDR008 should be replaced with a similar rule that disallows trailing whitespace on all lines except the page description. Following this, our .editorconfig should include the rule:

[*.{markdown,md}]
trim_trailing_whitespace = false

Actual

image

Expected

image

SethFalco commented 3 years ago

An alternate solution could be the following:

It introduces an alternative syntax for hard line breaks, a backslash at the end of the line, supplementing the two-spaces-at-the-end-of-line rule. This is motivated by persistent complaints about the “invisible” nature of the two-space rule. - https://github.com/commonmark/commonmark-spec#differences-from-original-markdown

So to leave this rule intact, but require a \ at the end of the line before the more info line.

marchersimon commented 3 years ago

I'm not a fan of how that would look, but two spaces after each line isn't really better. Also, it would be annoying if we would have to make sure every contributer follows this syntax. I assume we also can't automatically add them, since that would prabably create issues for contributors when pushing new changes without pulling.

SethFalco commented 1 year ago

Reopening this as it's still an issue as long as declare we use Markdown files.