vanitydoc command

go install

vanitydoc generates go documentation as a static site (HTML and Gemtext). When hosted at the package URL, it makes the package importable by the Go tools ("vanity import path").

For instance the import path for this command is and the documentation is hosted at the following URL:


vanitydoc [flags] <forgeURL>

The forgeURL must specify the forge in the scheme. See autodiscovery.ParseURL


The flags are:

-gemtext string
	Output folder for Gemtext (not generated if left empty)
-html string
	Output folder for HTML (default "dist")
-input string
	JSON input listing the packages to generate the documenation for.
	Usually generated by running 'go list -json="Dir,ImportPath,Doc" ./...' (default "-": reading from stdin)

Example to generate the documentation for this module:

go list -json="Dir,ImportPath,Doc,Module" ./... | go run -html=dist/html -gemtext=dist/gmi gitea://

Most of the templates originate from gddo. The CSS styling is achieved using simple.css by default. It includes the go-import meta tag as well as the meta tags proposed by the VCS Autodiscovery RFC


Source Files

ideas.go main.go


Path Synopsis
autodiscovery package autodiscovery is an implementation of the [VCS Autodiscovery RFC].
pkg package pkg computes and generate documentation for a given package.


git clone