gomarkdoc
gomarkdoc copied to clipboard
support new godoc spec enforced by gofmt
gofmt has a new # syntax for inferred headers. see release notes https://go.dev/doc/go1.19#go-doc.
support this by not escaping headers beginning with # in godoc.
example
example.go
// Package example ...
//
// # Documentation
//
// documentation...
package example
results in markdown with the header's # escaped
README.go
...
\# Documentation
...
Just FYI: The go/doc/comment.Printer includes a Markdown method that formats the new godoc comments as Markdown. This may ease the implementation on gomarkdoc.
I gave it a shot and tried to implement @abhinav suggestion.
While my PR is being reviewed, you can give it a try with
go run github.com/phsym/gomarkdoc/cmd/gomarkdoc@latest
Hi all, thanks for opening this issue and working through possible solutions. The go 1.19 language support was a while in the making but is now available as part of the latest release (via #86, #87 and #89). Please try updating and open new issues for anything you encounter that is still broken with the latest code.