Show version tag of package?
Opened this issue · 1 comments
I was wondering if it was possible to show multiple versions of a package.
I'm looking to set up an internal package docs service for our company. Our users may be developing using different versions of a package. It would be nice to be able to show docs for multiple versions of a package. We manage versions in the common idomatic manner of using git tags of format "v0.0.1" etc.
I realize that showing all versions would be difficult as you'd have to be git aware and loop through all history of git tags in a package dir that's been identified as a git repo.
Maybe some opinionation of how someone could host multiple versions of a package would be nice. That way we could package up the versions of a package as artifacts and export to a standard format that the GUI is aware of. E.g., if golds is serving a directory of packages and it sees the following contents:
mypackage_v0.0.1_
mypackage_v0.0.2_
otherpackage_v0.3.4_
The GUI knows to strip the underscores and parse the version and inject into the GUI somehow. Obviously pkg.go.dev is version aware so you could easily generate the links to the specific versions.
Package mypackage (v0.0.1)
Import Path
[github.com/myorg/mypackage](http://localhost:56789/#pkg-github.com/myorg/mypackage) (on [go.dev](https://pkg.go.dev/github.com/myorg/mypackage@v0.0.1))
...
Package mypackage (v0.0.2)
Import Path
[github.com/myorg/mypackage](http://localhost:56789/#pkg-github.com/myorg/mypackage) (on [go.dev](https://pkg.go.dev/github.com/myorg/mypackage@v0.0.2))
...
Package otherpackage (v0.3.4)
Import Path
[github.com/myorg/mypackage](http://localhost:56789/#pkg-github.com/myorg/otherpackage) (on [go.dev](https://pkg.go.dev/github.com/myorg/otherpackage@v0.3.4))
Just thinking of ways to do it without a ton of git work.
Sorry for just noticing this issue.
Yes, Golds currently only handles one minor version for every major version of a module.
You can generate the docs of different versions of a module by running golds
multiple times.
The external go.dev
links are always the latest versions now.
Now Golds can parse and get the versions of dependency modules, but can't get the version of the seed packages
(the packages specified in the command line in a golds
command).
Surely, golds
can be improved by generating docs for a git repository directory.
But this needs some effort to finish.
If I have enough spare time, I will continue improving this project.
But I can't promise anything now.