go101/golds

Support Go 1.19 godoc formatting

ainar-g opened this issue · 7 comments

See golang/go#51028 golang/go#51082. It seems like this should mostly be a matter of updating some dependencies, but I don't know for sure.

@ainar-g
Sorry, I just noticed this issue.
It looks the linked issue is unrelated. Is it golang/go#16666 or golang/go#51082?

@go101, the latter, yes. Apologies, hand copying strikes again, heh.

If it is applicable, Golds will use the official code as dependency.
If this is not possible or there are difficulties in this way, then Golds might render the comments with slightly different rules.

I'm not sure I follow, sorry. I've built a local copy of golds using the latest golang.org/x/tools as well as a development version of Go 1.19 from master, but the resulting binary doesn't show headers or lists from the proposal in the web interface.

gotip version -m $( which golds )
/home/ainar/go/bin/golds: devel go1.19-1a2ca95ad2 Thu Jun 9 01:07:11 2022 +0000
        path    go101.org/golds
        mod     go101.org/golds (devel)
        dep     golang.org/x/mod        v0.6.0-dev.0.20220419223038-86c51ed26bb4        h1:6zppjxzCulZykYSLyVDYbneBfbaBIQPYMevg0bEwv2s=
        dep     golang.org/x/net        v0.0.0-20220225172249-27dd8689420f      h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc=
        dep     golang.org/x/sys        v0.0.0-20211216021012-1d35b9e2eb4e      h1:fLOSk5Q00efkSvAm+4xcoXD+RRmLmmulPn5I3Y9F2EM=
        dep     golang.org/x/text       v0.3.7  h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk=
        dep     golang.org/x/tools      v0.1.11-0.20220608221525-4a8620f6ba29   h1:GY4oxXkEP5h9DKhSS69+lDMbM9BvK5egPBs51R5PGrI=
        build   -compiler=gc
        build   CGO_ENABLED=1
        build   CGO_CFLAGS=
        build   CGO_CPPFLAGS=
        build   CGO_CXXFLAGS=
        build   CGO_LDFLAGS=
        build   GOARCH=amd64
        build   GOOS=linux
        build   GOAMD64=v1
        build   vcs=git
        build   vcs.revision=c9f23ad288322a6d36ec08d755efdf6a15a2a287
        build   vcs.time=2022-06-09T13:36:39Z
        build   vcs.modified=true

This feature has not been implemented in Golds yet.
Go 1.19 will introduce a go/doc/comment package, Golds will use it if applicable.
But it is not guaranteed to be implemented as such.
That means Golds will only write some links but not support headers and lists.

Ah, I see, thanks.

@ainar-g

A new -render-doclinks option is added to render links in doc comments.
Some implementation details might differ from the official ones.

And I decide not to render bullets and headings.

A new release will be made several days later.