Images in godoc?
Asked Answered
O

1

7

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.

Oleoresin answered 7/6, 2016 at 0:12 Comment(3)
godoc doesn't support it. The present/article format does with .image; the format is described at godoc.org/golang.org/x/tools/present and e.g. 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.)Volumeter
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.Volumeter
The closest to images is ASCII art in code blocks (which works okay for not too large diagrams).Abseil
G
7

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

Gi answered 7/6, 2016 at 0:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.