Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support new godoc spec enforced by gofmt #81

Closed
jeffatgametime opened this issue Sep 23, 2022 · 3 comments
Closed

support new godoc spec enforced by gofmt #81

jeffatgametime opened this issue Sep 23, 2022 · 3 comments

Comments

@jeffatgametime
Copy link

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
...
@abhinav
Copy link

abhinav commented Oct 28, 2022

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.

@phsym
Copy link

phsym commented Dec 16, 2022

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

@princjef
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants