Add a warning header to commands/settings.asciidoc

See #1802
This commit is contained in:
Florian Bruhin 2016-08-08 22:54:07 +02:00
parent 5668a5e71a
commit ec21041516
3 changed files with 17 additions and 0 deletions

View File

@ -1,3 +1,7 @@
// DO NOT EDIT THIS FILE DIRECTLY!
// It is autogenerated from docstrings by running:
// $ python3 scripts/dev/src2asciidoc.py
= Commands
== Normal commands

View File

@ -1,3 +1,7 @@
// DO NOT EDIT THIS FILE DIRECTLY!
// It is autogenerated from docstrings by running:
// $ python3 scripts/dev/src2asciidoc.py
= Settings
.Quick reference for section ``general''

View File

@ -42,6 +42,13 @@ from qutebrowser.commands import cmdutils, argparser
from qutebrowser.config import configdata
from qutebrowser.utils import docutils, usertypes
FILE_HEADER = """
// DO NOT EDIT THIS FILE DIRECTLY!
// It is autogenerated from docstrings by running:
// $ python3 scripts/dev/src2asciidoc.py
""".lstrip()
class UsageFormatter(argparse.HelpFormatter):
@ -312,6 +319,7 @@ def _format_action(action):
def generate_commands(filename):
"""Generate the complete commands section."""
with _open_file(filename) as f:
f.write(FILE_HEADER)
f.write("= Commands\n")
normal_cmds = []
hidden_cmds = []
@ -395,6 +403,7 @@ def _generate_setting_section(f, sectname, sect):
def generate_settings(filename):
"""Generate the complete settings section."""
with _open_file(filename) as f:
f.write(FILE_HEADER)
f.write("= Settings\n")
f.write(_get_setting_quickref() + "\n")
for sectname, sect in configdata.DATA.items():