The dumbdown
command provides a simple conversion from go doc
to
markdown.
During conversion, some not-needed text is omitted; while heading text is
prepended with ##
to become a markdown header.
The conversion is, by design, not particularly smart (hence the name).
Usage
Run from the command line:
go doc | dumbdown > README.md
To automatically build README.md, add "go:generate" comments to source:
//go:generate sh -c "go doc | dumbdown > README.md"
then at build-time run:
go generate ./...