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 #82

Closed
wants to merge 3 commits into from

Conversation

phsym
Copy link

@phsym phsym commented Dec 16, 2022

Hi ! Thanks for this awesome tool.

As stated in #81 unfortunately, it does not play well with the new godoc spec. Like headers, or links references.

This PR is an attempt to delegate the parsing of docstrings to go/doc/comment.Parser, and markdown rendering (escaping) to go/doc/comment.Printer as suggested in a comment of #81

I may have missed things but from the tests I did on a large codebase, it seems to be working quite well.

I also updated to go 1.19

You can give it a try with

go run github.com/phsym/gomarkdoc/cmd/gomarkdoc@latest

Fixes #81

phsym added a commit to phsym/gomarkdoc that referenced this pull request Dec 16, 2022
This is temporary so that we can go run from this repo waiting for the PR princjef#82 to be reviewed and merge
phsym added a commit to phsym/gomarkdoc that referenced this pull request Dec 16, 2022
This is temporary so that we can go run from this repo waiting for the PR princjef#82 to be reviewed and merge
phsym added a commit to phsym/gomarkdoc that referenced this pull request Dec 19, 2022
This is temporary so that we can go run from this repo waiting for the PR princjef#82 to be reviewed and merge
Make use of go/doc and go/doc/comment std packages to parse and ender godoc paragraph
phsym added a commit to phsym/gomarkdoc that referenced this pull request Dec 19, 2022
This is temporary so that we can go run from this repo waiting for the PR princjef#82 to be reviewed and merge
phsym added a commit to phsym/gomarkdoc that referenced this pull request Dec 21, 2022
This is temporary so that we can go run from this repo waiting for the PR princjef#82 to be reviewed and merge
phsym added a commit to phsym/gomarkdoc that referenced this pull request Dec 24, 2022
This is temporary so that we can go run from this repo waiting for the PR princjef#82 to be reviewed and merge
@princjef
Copy link
Owner

@phsym thanks for the PR! This is a big update that clearly took some time to put together. I unfortunately already had most of the implementation put together in a separate change which I ended up using for the final version of the go 1.19 support, so I won't be able to merge this as is.

It looks like you may have some specific functionality (such as the GOPRIVATE support) which I didn't implement in my version. If you're interested in trying to port that and other relevant logic over I'd happily work with you to get it merged, though I understand it's been a while and you may not have the time/inclination at this point. Let me know your thoughts.

@princjef
Copy link
Owner

princjef commented Aug 19, 2023

Superseded by #87 and #89

@princjef princjef closed this Aug 19, 2023
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 this pull request may close these issues.

support new godoc spec enforced by gofmt
2 participants