doc2go

Welcome to doc2go.

What is doc2go?

doc2go is a tool to generate API documentation from Go source code. It takes your Go source code, and generates a static HTML website from it.

doc2go reads Go, generates HTML

Embedded mode

doc2go additionally supports an embedded mode.

In this mode, it generates fragments of HTML instead of a whole website. You can feed this output into a static website generator like Hugo or Jekyll and make doc2go’s output part of a bigger website.

doc2go reads Go, generates partial HTML

Why should I use it?

You should use doc2go if you’re a library maintainer with one of the following needs:

  • self-hosting documentation for your packages
  • distributing documentation with your software
  • deploying the API reference alongside your user guide
  • branding your documentation

You should use doc2go if you’re a library user who wants to keep offline copies of documentation for libraries that you use.

Non-goals

doc2go does not aim to introduce new syntax to the Go documentation comments. All documentation processed by doc2go must remain valid, as defined by the official Go documentation tooling.

How does it look?

To get an idea of how the output looks, check out the following links:

A documentation website generated from doc2go’s own source code is available here.

A standalone website generated from the Go standard library is available here.

A copy of the same documentation embedded into this website is available here.


Getting started

Start using doc2go from zero.

Installation

Install doc2go on your machine.

Usage

Learn how to use doc2go.

Embedding

Embed the output of doc2go into another website.

Publishing

Pubslihing the output of doc2go.

Frequently asked questions

Last modified February 26, 2024: Upgrade to latest Hugo (#214) (0f851c2)