mvdan / mvdan.cc

Personal website
3 stars 0 forks source link

hosted documentation at the "vanity URL" #6

Open oliverpool opened 6 months ago

oliverpool commented 6 months ago

Hi, first of all thank you for all your free-software work for the Go community!

I wrote a tool to generate Go module documentation as static HTML files, which can be hosted on the same URL as the import path: https://code.pfad.fr/vanitydoc/

I see that you are currently using a bash script to create a bunch of HTML pages redirecting to github.

Would you be interested into looking further into this, here is what the configuration would look like for your modules (vanitydoc.json file):

{
  "defaults": {
    "type": "github",

    "url_prefix": "https://github.com/mvdan/",
    "default_branch": "master",
    "archive_ref_prefix": "heads/"
  },

  "modules": {
    "benchinit": {},
    "bitw": {},
    "corpus": {},
    "dockexec": {},
    "editorconfig": {},
    "fdroidcl": {},
    "garble": {},
    "git-picked": {},
    "gofumpt": {},
    "gogrep": {},
    "goreduce": {},
    "nowt": {},
    "responsefile": {},
    "route": {},
    "sh/v3": {},
    "unparam": {},
    "xurls/v2": {},
    "zstd": {}
  },

  "html": {
    "output": "."
  },

  "max_conns_per_host": 3
}

The HTML files can then be generated by running go run code.pfad.fr/vanitydoc@latest vanitydoc.json.

Pro:

Cons:

PS: I hope you don't mind this shameless self-promotion too much; feel free to simply close this issue if you are not interested

mvdan commented 6 months ago

Thanks for the info! Just so I understand, is your tool an HTTP server, or a static HTML file generator? This website is hosted via github pages, meaning basically just static files, and I'd rather not need to run or manage an HTTP server unless I really have to.

oliverpool commented 6 months ago

The latter: a static HTML file generator.

It would be more or less a replacement of your gen-go-modules.bash (generate static HTML file from a list of modules).