6

Is there any way to add images (local or remote) to the HTML version godoc generates?

This is really useful for including diagrams that just can't be explained easily with words.

Elliot Chance
  • 5,526
  • 10
  • 49
  • 80
  • 3
    godoc doesn't support it. The present/article format does with .image; the format is described at https://godoc.org/golang.org/x/tools/present and e.g. https://godoc.org/golang.org/x/tools/blog uses it for non-presentation blog articles. But once you're supplementing your documentation outside godoc, maybe it just makes more sense to write Markdown and have Hugo or GitHub render it, or write HTML. (In the godoc, you can always include the URL of images or outside pages I suppose.) – twotwotwo Jun 07 '16 at 00:42
  • Worth noting that godoc is, effectively, a package reference, and much nontrivial software, including Go, has a lot of other documentation/writing about it outside of the package reference. – twotwotwo Jun 07 '16 at 00:44
  • 1
    The closest to images is ASCII art in code blocks (which works okay for not too large diagrams). – Volker Jun 07 '16 at 05:30

1 Answers1

6

The godoc tool does not provide a way to add images to documentation.

Charlie Tumahai
  • 113,709
  • 12
  • 249
  • 242