diff --git a/doc/help/commands.asciidoc b/doc/help/commands.asciidoc index 36c2d9653..e21fd3558 100644 --- a/doc/help/commands.asciidoc +++ b/doc/help/commands.asciidoc @@ -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 diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 628a029e1..1bc70e45f 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -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'' diff --git a/scripts/dev/src2asciidoc.py b/scripts/dev/src2asciidoc.py index 84b774a03..f76d8bb59 100755 --- a/scripts/dev/src2asciidoc.py +++ b/scripts/dev/src2asciidoc.py @@ -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():