tldr-pages / tldr-node-client

Node.js command-line client for tldr pages
https://www.npmjs.com/package/tldr
MIT License
431 stars 71 forks source link

Rendered output displays "See also:" line twice #431

Open kbdharun opened 8 months ago

kbdharun commented 8 months ago

Expected behavior

Continuing https://github.com/tldr-pages/tldr/issues/5190#issuecomment-1852054873 (cc @sbrl).

The rendered output of pages should be displayed as is without a redundant "See also:" entry below the pages.

Actual behavior

Currently, the rendered output of pages displays the "See also:" line twice and in pages using a description like encfs it might be useful but still redundant.

image

Also in pages where we add it to an existing line in those cases this additional rendering doesn't take place:

image

What do you guys think, should we remove it? (IMO removing it will make the rendering consistent with other clients which doesn't do this)

If we decide to go with it, removing the below lines would resolve this issue:

https://github.com/tldr-pages/tldr-node-client/blob/3e65c255e690ab98bdb9e9e91003eb435a39bc8b/lib/render.js#L48-L52

Environment

sbrl commented 8 months ago

Where is the bottom See also pulled from? If it's taken from the page content, I don't particularly see a reason to keep it.

I wonder what the reasoning was behind adding it in the first place was?

kbdharun commented 8 months ago

Where is the bottom See also pulled from? If it's taken from the page content, I don't particularly see a reason to keep it.

Yep, it's taken from the page content.

I wonder what the reasoning was behind adding it in the first place was?

Same here, it was implemented in #81 and it seems to be discussed here in https://github.com/tldr-pages/tldr/issues/481.

owenvoke commented 8 months ago

I agree that it doesn't really make much sense, as it's usually already within the page. 👍🏻

sbrl commented 6 months ago

Ahh I see. This feature parses

(see `blah`)

lines in descriptions, but fails to account for if they are mentioned in the See also description line.

In this case, I would consider this a bug in that feature.