Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/doc: support custom output format #41744

Open
CAFxX opened this issue Oct 2, 2020 · 2 comments
Open

cmd/doc: support custom output format #41744

CAFxX opened this issue Oct 2, 2020 · 2 comments
Labels
FeatureRequest NeedsInvestigation
Milestone

Comments

@CAFxX
Copy link
Contributor

@CAFxX CAFxX commented Oct 2, 2020

What version of Go are you using (go version)?

1.15.2

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

darwin/amd64

What did you do?

I am using go doc to automatically generate static documentation for internal repositories.

What did you expect to see?

A way to provide a text/template to control the output format or, alternatively, a way to output the data in a standard machine-parseable format (e.g. json, yaml, ...) that I can use to drive custom output generation.

What did you see instead?

go doc does only provide a single format for direct human consumption.

@CAFxX CAFxX changed the title cmd/doc: add support for templates cmd/doc: support custom output format Oct 2, 2020
@robpike
Copy link
Contributor

@robpike robpike commented Oct 2, 2020

The program really wasn't written with that in mind. It might be convertible but it would be a lot of work. You'd likely be better off hacking up something using go/doc directly.

@dmitshur dmitshur added FeatureRequest NeedsInvestigation labels Oct 6, 2020
@dmitshur dmitshur added this to the Unplanned milestone Oct 6, 2020
@icholy
Copy link

@icholy icholy commented May 19, 2021

I used the (now changed) godoc -templates flag to implement go doc tab completion for zsh: https://github.com/ohmyzsh/ohmyzsh/blob/d646884add277d134235a9b18ab755388d6e0d8d/plugins/golang/golang.plugin.zsh#L68

It's unfortunate that there's no alternative with the current tooling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FeatureRequest NeedsInvestigation
Projects
None yet
Development

No branches or pull requests

4 participants