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

Show version tag of package? #47

Open
rendicott opened this issue Mar 4, 2024 · 1 comment
Open

Show version tag of package? #47

rendicott opened this issue Mar 4, 2024 · 1 comment

Comments

@rendicott
Copy link

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.aaakk.us.kg/myorg/mypackage) (on [go.dev](https://pkg.go.dev/github.com/myorg/[email protected]))

...

Package mypackage (v0.0.2)

Import Path
	[github.com/myorg/mypackage](http://localhost:56789/#pkg-github.aaakk.us.kg/myorg/mypackage) (on [go.dev](https://pkg.go.dev/github.com/myorg/[email protected]))

...

Package otherpackage (v0.3.4)

Import Path
	[github.com/myorg/mypackage](http://localhost:56789/#pkg-github.aaakk.us.kg/myorg/otherpackage) (on [go.dev](https://pkg.go.dev/github.com/myorg/[email protected]))

Just thinking of ways to do it without a ton of git work.

@zigo101
Copy link
Collaborator

zigo101 commented Mar 21, 2024

@rendicott

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.

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

No branches or pull requests

2 participants