nuttx icon indicating copy to clipboard operation
nuttx copied to clipboard

docs: Generate documentation from the kconfig files

Open btashton opened this issue 3 years ago • 7 comments

Summary

This generates documentation as reference that can be used from the Kconfig files.

This is not ready to merge this is just for feedback on the idea. I am still trying to figure out what the best way to make this work is. Building all of this take a long time for sphinx on the first pass as it generates ~16000 files. Other projects that do something similar just create a stub file for the references that can be used for normal building and only when you want to build the final documentation package do you generate the full rendering of the pages, I think that would be very reasonable.

The output looks something like this with all the CONFIG_ as references that you can click

image

btashton avatar Apr 26 '21 08:04 btashton

@btashton - I think this is great! It also has as side benefit of us putting more effort into more detailed help in the Kconfig files. Sometimes even a one line of explanation can save lots of grepping.

davids5 avatar Apr 26 '21 13:04 davids5

This is a great idea! I think it also will spot many Kconfig entry that are missing Help information!

acassis avatar Apr 26 '21 13:04 acassis

There is a tool at tools/mkconfigvars.sh and tools/kconfig2html.c that I used to use to generate online configuration variable documentation. It would generate a 10Mb or so HTML file with collapsible hyperlinked TOC and cross-referenced dependencies.

patacongo avatar Apr 26 '21 13:04 patacongo

There is a tool at tools/mkconfigvars.sh and tools/kconfig2html.c that I used to use to generate online configuration variable documentation. It would generate a 10Mb or so HTML file with collapsible hyperlinked TOC and cross-referenced dependencies.

There is still a very old generated HTML file online: https://cwiki.apache.org/confluence/display/NUTTX/Configuration+Variables

That should be removed. It is way out of date. I would update that file on each release so that it reflects the current state of configuration variables.

patacongo avatar Apr 26 '21 13:04 patacongo

Nice. I always thought this would be good to have, accompanied with a sphinx role such as :kconfig:<config var> which would link to the documentation of the variable. Maybe we can look into how to achieve that. BTW, together with the CMake system I intend to have a specific documentation section such as "Build System". I imagine This section be a sibling of this one. I tried to think of a top-level section that could group these and other related sections but I can't come up with an appropriate name. I thought about something like "Developer Guide" (which also allows for other sections explaining how to add new board, app, arch, etc.). What do you think?

protobits avatar Apr 26 '21 15:04 protobits

BTW, why 16000 files? Do we have 16000 config vars??

protobits avatar Apr 26 '21 15:04 protobits

Nice. I always thought this would be good to have, accompanied with a sphinx role such as :kconfig:<config var> which would link to the documentation of the variable. Maybe we can look into how to achieve that.

This already does that you just have to do :option:`CONFIG_FOO` and it will create the reference for you.

This was actually my main motivation because I want to link to this from the board documentation so we can stop documenting the same things over and over with stale information.

As for the 16000 files yes there are that many configuration variable. Most of them are arch and chip specific.

btashton avatar Apr 26 '21 15:04 btashton

@hartmannathan this was my stab at this feature

btashton avatar Jan 22 '23 18:01 btashton