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
[doc] Add support for taking in text/template
s for generating docs
#2084
Comments
I was just going to begin implementing this myself, but from the point of turning the Yaml docs into "Just another output":
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As well as the excellent support we've got built-in for rendering documentation, it'd be handy to be able to further customise the output.
For instance, I'd quite like to add additional metadata to the pages, or i.e. use it in a
.mdx
file that can have other more complex setup around it, in a way that isn't as straightforward within the built-in means.Although I could hand-roll this, it'd be quite convenient to have it as a first-class citizen for upstream consumption, but if you feel it's not worthwhile, that's cool too.
I've hacked together a repository in https://gitlab.com/tanna.dev/cobra-doc-template which has somewhat reverse-engineered the way that the existing Markdown docs work.
I have also created https://gist.github.com/jamietanna/020c15bbe5e6b258391fa3ded9861e38 which shows:
main.go
This then produces a tree of Markdown-formatted docs, which are (effectively) identical to those rendered by Cobra's
doc.GenMarkdownTreeCustom
.Note a few key differences:
The code is Apache-2.0 licensed - as with Cobra - and I'd be happy to work to get this contributed upstream if you're interested!
The text was updated successfully, but these errors were encountered: