dbrgn / tealdeer

A very fast implementation of tldr in Rust.
https://dbrgn.github.io/tealdeer/
Apache License 2.0
4.01k stars 120 forks source link

Option to show the original page when custom page/patch exists #367

Open brainwo opened 1 month ago

brainwo commented 1 month ago

Perhaps something like tldr --original git to render the original file, or tldr --path git to show where git.md file is located. This is useful when working with a patch.

niklasmohrin commented 1 month ago

I suppose this would be covered by #306? With an environment variable, you could env TEALDEER_PAGE_PATH=/ TEALDEER_PATCH_PATH=/ tldr ..., or whatever syntax we come up with there. Is there any motivation for a separate option?

brainwo commented 1 month ago

I was thinking of a way to easily generate diff.

diff <(tldr git) <(tldr --original git)

But I guess if we go with only supporting environment variable that would be something like this?

diff <(tldr git) <(TEALDEER_PAGE_PATH=/ tldr git)
niklasmohrin commented 1 month ago

To be honest, I think the use case is very niche. Currently, I would prefer to not add extra settings as in your initial suggestion, but we can leave this issue open for some time and see from the reactions if more people would be interested