Improving Offline Go Doc

Hi
I know GO TOOLING, is something we as a community pride our self. After doing some research and speaking to people. in the community both online and offline, I have realized that official go doc for offline documentation export is possibly lacking. Sorry to compare to JavaDoc, but needed some bench mark and I understand GoDoc has some cool things no one else has , but am only highlighting and calling a spade a spade (Please dont be offended. I LOVE GO already, and here to make it better) :slight_smile:

Below are list of points And below that I’ve listed my research / basis for saying this. Ams also pasting this on community as this is a request and I wonder how many in the community would agree beyond my initial find.

Note: Note using wget is a Hack not a solution ; ive read posts encouraging this. And as a community if we are satisfied then no need to read this further. But if most feel its not then please read on.

Points

  1. Web access to live documentation is really cool; however I know a lot of people consume DOCs in offline mode. Maybe the Live approach is suited for CI/CD but not typical product delivery scenarios.

  2. I’ve found the auto linking capability in Go Doc does not interpret my comment. In that case how can I specify a link to a relative path? (localhost, annotation?) … sorry didnt mean HOW as a HOW on community but rather a suggestion this is not clean.

  3. Templatization, CSS or SCSS customization. I keep thinking am wrong and this must be there but I did not find anything to officially support it. My google search words were Customize style "Godoc" and Customize CSS "Go doc". Pretty also was there but nothing standard showed up. Surprising.
    Obvious Suggestions:

  • A simple flag with the path to CSS can include it in all generated pages and assuming the standard docs use CSS selectors can be a quick win. If CSS path is relative, the file in included in the export; if absolute then no need to include.
  • Also blank selectors for Logo etc can be provided.

Basis

To generate Go-Doc offline it’s need some tricks to do.
Actually GoDoc can provide export as HTML file as well, but its will require some efforts, so to minimalize it I used web scrapper tools to get offline GoDoc.
Run it as usual then using web scrapper to capture all pages include all links have.
May this is not a best practice but will save more time to get the result.
2 Likes

I’m with on this one. Been working for a Markdown generator (either work it out on my own) for quite some times to upgrade my doc module.

Have you tried expand from https://github.com/robertkrimen/godocdown alongside with Hugo (as local server)?

The source codes in it probably has something you want (and I want too since I got the Hugo part solved) :grin:.

1 Like

Thanks! This is useful.

2 Likes

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.