Coder Social home page Coder Social logo

goduck's Introduction

GoDuck

Godoc is a built-in tool in Go that allows to extract and generate documentation for Go programs automatically. Godoc can be either run as a webserver to view the documentation as a website in a browser or be used to print text or html output to standard output. The output can be, of course, redirected to a file for an offline presentation of the documentation.

Unfortunately, if one wants to generate offline documentation for a complete package, he/she has to godoc every Go file in the package and manage the links between HTML files manually. This is what GoDuck does automatically.

GoDuck establishes a Godoc webserver automatically on a random port and downloads the complete package documentation from the server. It corrects all URLs in the downloaded HTML files to avoid broken links. It also removes unnecessary links, buttons, etc from the downloaded Godoc pages to generate good-looking HTML files that can be browsed completely offline from the Internet and without requiring to establish a Godoc webserver on the target machine.

Usage

To use GoDuck, you need Python 2.7+ with Beautiful Soup and Go installed on your machine. You can install Beautiful Soup from here and Go from here.

Once you have both installed run GoDuck using

python goduck.py -d [package to be goducked] -o [output directory] -t [project title]

For example,

python goduck.py -d github.com/dedis/cothority -o /Users/mahdiz/goduck -t "The Cothority Project"

You can then browse the package documentation by opening doc.html from the output directory. Clicking on links in this HTML page will take you to other HTMLs that correspond to other Go source files in the package.

goduck's People

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.