cobra
cobra copied to clipboard
Allow for Custom GenMarkdown Function to be Used with GenMarkdownTreeCustom
When using GenMarkdownTreeCustom
to generate markdown docs, it would be helpful to be able to specify my own GenMarkdownCustom
func as opposed to the one used by Cobra in order to include other properties in markdown documentation (e.g., Aliases
).
While it's certainly doable to create and maintain doc generation without relying on this implementation, it would be helpful make use of many helper funcs available while having more control over the format of docs. Not sure if there already is some kind of approach for this, but couldn't find much and would appreciate any approaches that might allow more control over doc format.
This issue is being marked as stale due to a long period of inactivity
I haven't used this particular feature before but its not immediately obvious to me why its coded as it is instead of utilizing a template that can be overridden like the basic CLI help.
I'm open to discussing alternate ideas for accomplishing this; I'd expect the help to be as customizable as you want.
Maybe someone with more experience on this portion of the tool already knows of a workaround?
This came up today in a project where we use cobra. We'd like to display aliases
as well.
I'd be happy to discuss if its possible to define a new GenMarkdownTreeCustomV2
or something that takes a func as @danielhelfand suggested.
I would also like to see something like this, as I need to customize the markdown quite a bit more than the current GenMarkdown* functions allow. For the time being, that involves basically replicating all of the GenMarkdown* logic, but there's no reason it has to be that way.