From c5d923f92eb67234b27052a281284c9b61771025 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 28 May 2014 19:12:12 +0200 Subject: [PATCH] Add settings to documentation --- scripts/generate_manpage.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/scripts/generate_manpage.py b/scripts/generate_manpage.py index 0923bc0ef..0636b32f1 100644 --- a/scripts/generate_manpage.py +++ b/scripts/generate_manpage.py @@ -25,6 +25,7 @@ sys.path.insert(0, os.getcwd()) import qutebrowser.app import qutebrowser.commands.utils as cmdutils +import qutebrowser.config.configdata as configdata from qutebrowser.utils.usertypes import enum @@ -138,4 +139,33 @@ def generate_commands(): for name, cmd in hidden_cmds: print(get_command_doc(name, cmd)) + +def generate_settings(): + print("== Settings") + for sectname, sect in configdata.DATA.items(): + print() + print("=== {}".format(sectname)) + print(configdata.SECTION_DESC[sectname]) + if not getattr(sect, 'descriptions'): + pass + else: + for optname, option in sect.items(): + print() + print("==== {}".format(optname)) + print(sect.descriptions[optname]) + print() + valid_values = option.typ.valid_values + if valid_values is not None: + print("Valid values:") + print() + for val in valid_values: + try: + desc = valid_values.descriptions[val] + print(" * _{}_: {}".format(val, desc)) + except KeyError: + print(" * _{}_".format(val)) + + + +generate_settings() generate_commands()