GithubHelp home page GithubHelp logo

Comments (12)

ChrisCummins avatar ChrisCummins commented on May 3, 2024 1

I know this thread is long dead, but incase anyone stumbles on this while Googling a solution, I use a help function defined in my .bashrc to set man as a fallback:

help() {
    tldr "$@" 2>/dev/null || { echo "No tldr entry for $1 (try tldr --update)"; man "$@" }
}

If you dont like that man is fullpage, use a different pager than the default (less). E.g. to print only the first 50 lines of the manpage:

help() {
    tldr "$@" 2>/dev/null || { echo "No tldr entry for $1 (try tldr --update)"; MANPAGER="head -n50" man "$@" }
}

from tldr.

nelsonpecora avatar nelsonpecora commented on May 3, 2024

Maybe a short message saying "Sorry, no tldr page yet. Create one at [url]!" then a 2 second pause before loading the man page?

from tldr.

rprieto avatar rprieto commented on May 3, 2024

I'm not sure about the auto-opening, especially since man pages go full-screen.
Maybe a prompt like this?

No TLDR page for "ssh" yet.
Please consider contributing to the project.

- Press [o] to browse to http://github.com/rprieto/tldr
- Press [m] to open the man page instead
- Press any other key to exit

Although that's a change from the usual tldr behaviour which is to print something and exit.

from tldr.

nelsonpecora avatar nelsonpecora commented on May 3, 2024

Ooh, I really like @rprieto's idea. Would [o] just do something like open http://github.com/rprieto/tldr? (I know that opens the default browser on OSX, but not sure about other *nix).

from tldr.

rprieto avatar rprieto commented on May 3, 2024

That's what I had in mind, let's find the other *nix equivalents!

from tldr.

nelsonpecora avatar nelsonpecora commented on May 3, 2024

Hmm. Looks like there really aren't any other *nix equivalents, but you could check if chrome / firefox is installed and call them.

from tldr.

waldyrious avatar waldyrious commented on May 3, 2024

Some pointers here, but indeed it seems there's no universal solution.

from tldr.

rprieto avatar rprieto commented on May 3, 2024

I don't have a Linux machine handy to try it, but ghwd uses:

# mac and linux-compatible open
open=open
command -v xdg-open && open=xdg-open
$open $url

from tldr.

waldyrious avatar waldyrious commented on May 3, 2024

That's what is pointed out in the SO post I linked to. A comment there says it doesn't work on RHEL, but I suppose apart from that its support base is probably wide enough for a start. Besides, if someone can eventually contribute something better, there are always issues and pull requests :)

from tldr.

rprieto avatar rprieto commented on May 3, 2024

Sorry, I was on the train and hadn't read your link yet 😬
You're right this should be a good start!

from tldr.

rprieto avatar rprieto commented on May 3, 2024

Just moving this issue over to tldr-node-client #9.
Each client can probably do it their own say, but I'll start work over there :)

from tldr.

waldyrious avatar waldyrious commented on May 3, 2024

Nice trick, thanks for sharing @ChrisCummins! By the way, do you think you could have any input in #527? We got a little blocked trying to come up with some generic shell scripting to implement that idea.

from tldr.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.