#!/usr/bin/python3 import kconfiglib import sys def write_kconfig_html(): kconf = kconfiglib.Kconfig(sys.argv[1]) output = sys.argv[2] for sym in sorted(kconf.unique_defined_syms, key=lambda x: x.name): for node in sym.nodes: if node.help is not None: with open( '{}/CONFIG_{}.html'.format(output, sym.name), mode='wt' ) as f: f.write('\n'.join([ '
', 'CONFIG_{}

'.format(sym.name), '
\n'.join(node.help.split('\n')), '

' ])) if __name__ == '__main__': write_kconfig_html()