import "code.pfad.fr/vanitydoc/autodiscovery"
package autodiscovery is an implementation of the VCS Autodiscovery RFC.
type Forge struct { Summary string // overview of the project Dir string File string // file with pretty printing Line string // file with specific line hightlighted RawFile string }
Forge indicates the URLs pattern available in the software forge (with {ref}, {path} and {line} as placeholders).
type VCS struct { // VCS Standard Tags Kind string // git, fossil, pijul... DefaultBranch string Clone []string // URLs for clones (unauthenticated first) Forge Forge }
VCS represents the Version Control System being used.
Forgejo generates VCS for forgejo/gitea. For instance "https://codeberg.org/pfad.fr/vanitydoc" and defaultBranch "main".
Github generates VCS for github. For instance "https://github.com/fluhus/godoc-tricks" and defaultBranch "main".
Infer tries to infer the VCS from the clone url (not reliable, use at you own risks!)
New creates a VCS of the given type (forgejo, gitsrht, hgsrht, github).
SourceHutGit generates VCS for git.sr.ht. For instance "https://git.sr.ht/~username/repo" and defaultBranch "main".
SourceHutHg generates VCS for hg.sr.ht. For instance "https://hg.sr.ht/~username/repo" and defaultBranch "tip".
GoImport writes the go-import meta tag.
GoSource writes the go-source meta tag. Its format officially does not contain the version however its seem to be used by pkgsite as {commit}.
MetaTags writes the VCS Autodiscovery RFC meta tags (which are not empty).