Code Monkey home page Code Monkey logo

gdoc's Introduction

gdoc

Go Report Card

gdoc is a small utility to search on GoDoc.org. It's also suitable to read package documents via command-line.

Warning: This tool is only tested on Linux and OSX.

Install

With a properly configured Go environment:

go get -u github.com/buraksezer/gdoc

Usage

Search something:

gdoc search <keyword>

gdoc lists the first 10 package as default. If you want to increase or decrease that number, use -c/--count parameter:

gdoc search -c 3 <keyword>

gdoc has an interactive mode. If you use the -i/--interactive parameter when you search something, gdoc lists packages with numbers and await for your action to fetch its document from GoDoc.org.

Sample output:

gdoc search -i memberlist
==> (1) github.com/hashicorp/memberlist
==> imports: 192 stars: 804
memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol.

==> (2) github.com/Nitro/memberlist
==> imports: 3 stars: 0
memberlist is a library that manages cluster membership and member failure detection using a gossip based protocol.

==> (3) github.com/journeymidnight/nentropy/memberlist
==> imports: 3 stars: 1
....
Give a number to read the document:

Read package documentation:

gdoc read <package path>

Sample usage:

gdoc read github.com/hashicorp/memberlist

Fetches the package document from GoDoc.org in text format and pipes to an available pager. gdoc looks for GDOC_PAGER and PAGER environment variables to get the pager command as respectively. If you want to disable paging, use --disable-pager parameter:

gdoc read --disable-pager <package path> 

gdoc supports aliases to access easily the frequently used documents. If you set an alias for a package previously, just use -a/--alias to get the document for that package.

gdoc read -a <alias>

Aliases:

In order to add an alias for a package:

gdoc alias set <short name> <package path>

Sample usage:

gdoc alias set memberlist github.com/hashicorp/memberlist

If you want to delete previously setted alias, just use del subcommand:

gdoc alias del <short name>

You can use list subcommand to list already setted aliases.

Contribution

gdoc is a free software, you feel free to send PRs to improve gdoc.

License

gdoc is licensed under the GNU General Public License v3.0 - see LICENSE for more details.

gdoc's People

Contributors

buraksezer avatar

Watchers

James Cloos avatar  avatar

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.