-- Leo's gemini proxy

-- Connecting to log.pfad.fr:1965...

-- Connected

-- Sending request

-- Meta line: 20 text/gemini; charset=utf-8

Vanitydoc reloaded


I created vanitydoc to be able to use my own domain for my go modules while being able to host the code on different forges.


Introductory post of vanitydoc (2022)


A couple of evolutions happened in the meantime.


Serving the documentation of the current module


If you now run the executable without any argument, it will start an HTTP server to display the documentation of the module of the current directory.


go run code.pfad.fr/vanitydoc@latest

This is very handy to make a quick review of the documentation as it will render. The documentation is generated at every page load (so no need to restart vanitydoc between edits, just reload the webpage).


Multi-module (JSON config)


I used vanitydoc to generate the documentation of all (~10) my Go modules. I initially wrote a Go program that started multiple instances of vanitydoc in parallel to achieve this. After a while, this became quite cumbersome to maintain, so I integrated this capability directly into vanitydoc. My Go program has now been replaced by a straightforward JSON file.


go run code.pfad.fr/vanitydoc@latest path/to/config.json

The configuration of the JSON file is a bit involved, and I finally took the time to document it in the README (thanks @1268 for opening issues on Codeberg, to help me fix this).


Configuration documentation of vanitydoc


Newcomers


Since 2022, I stumbled upon a couple of other tools, related to handling vanity URLs and documentation for Go modules:


GoHome


GoHome is an SQLite-based Go server to manage module information.


https://petersanchez.com/easily-host-go-modules-on-your-domain/

https://code.netlandish.com/~petersanchez/gohome


doc2go


Generate documentation from a Go module (however not suitable yet to host on the vanity URL since the `go-import` meta tags are not generated).


https://abhinav.github.io/doc2go/docs/


Do you know of any other tool in this field? Please let me know!


📅 2024-02-01


Back to the index


Send me a comment or feedback

-- Response ended

-- Page fetched on Tue May 14 08:39:49 2024