lazygit icon indicating copy to clipboard operation
lazygit copied to clipboard

Generate Config.md from JSON schema

Open stefanhaller opened this issue 11 months ago • 2 comments

The "Default" documentation in Config.md is out of date in several ways; we keep forgetting to add new keybindings, for example. (We have a checkbox in the PR template for that, but it doesn't seem to help enough.)

We should look into auto-generating that section from JSON schema to prevent it from getting out of date.

I had a very cursory look, and there seem to be tons of tools out there that can generate documentation (HTML or Markdown) from JSON schema; however, I haven't found one that produces output similar to what we have right now. Most of these tools are meant for API documentation, so they generate big tables with lots of detail that's not relevant for us. Some of these have a template feature though, so maybe this could be used to customize the output. I haven't looked closer at that yet. In the worst case we'd implement one ourselves, which doesn't seem super hard either since our schema is fairly simple.

Unfortunately we won't be able to make this a go generate thing, because I don't see a way to cascade generators, or define dependencies between them. We already have a generator for the schema, and that one will have to run first; this new one would then work on the output of the first one. I don't see how that's possible in go, so we'll have to make this a custom script.

stefanhaller avatar Mar 27 '24 07:03 stefanhaller

@karimkhaleel Since you did the great work on the schema generation and have some experience with the topic, would you be interested in looking into this?

stefanhaller avatar Mar 27 '24 07:03 stefanhaller

Yeah, this seems interesting. I'll take a look. Thanks for the callout!

karimkhaleel avatar Mar 27 '24 10:03 karimkhaleel