cobra icon indicating copy to clipboard operation
cobra copied to clipboard

Allow for Custom GenMarkdown Function to be Used with GenMarkdownTreeCustom

Open danielhelfand opened this issue 4 years ago • 3 comments

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.

danielhelfand avatar Oct 07 '20 15:10 danielhelfand

This issue is being marked as stale due to a long period of inactivity

github-actions[bot] avatar Dec 08 '20 00:12 github-actions[bot]

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?

johnSchnake avatar Mar 25 '22 14:03 johnSchnake

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.

FahadBSyed avatar Jun 22 '22 19:06 FahadBSyed

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.

joshuacc avatar Nov 11 '22 18:11 joshuacc