diff --git a/scripts/man_pages.py b/scripts/man_pages.py index 913a35b..0e8c0d4 100755 --- a/scripts/man_pages.py +++ b/scripts/man_pages.py @@ -27,6 +27,7 @@ import sys LOG = logging.getLogger() logging.basicConfig(stream=sys.stdout, level=logging.DEBUG) +zfs_repo_url = 'https://github.com/openzfs/zfs/' man_sections = { '1': 'User Commands', @@ -99,8 +100,9 @@ def run(in_dir, out_dir): os.makedirs(man_path, exist_ok=True) with open(os.path.join(man_path, 'index.rst'), "w") as f: f.write( - """ -.. THIS FILE IS AUTOGENERATED, DO NOT EDIT! + """.. THIS FILE IS AUTOGENERATED, DO NOT EDIT! + +:github_url: {zfs_repo_url}blob/master/man/ {name} {name_sub} @@ -109,7 +111,8 @@ def run(in_dir, out_dir): :glob: */index - """.format(name=man_section_name, + """.format(zfs_repo_url=zfs_repo_url, + name=man_section_name, name_sub="=" * len(man_section_name)) ) @@ -123,8 +126,9 @@ def run(in_dir, out_dir): name=section_name, num=section_num) with open(os.path.join(rst_dir, 'index.rst'), "w") as f: f.write( - """ -.. THIS FILE IS AUTOGENERATED, DO NOT EDIT! + """.. THIS FILE IS AUTOGENERATED, DO NOT EDIT! + +:github_url: {zfs_repo_url}blob/master/man/man{section_num}/ {name} {name_sub} @@ -133,14 +137,17 @@ def run(in_dir, out_dir): :glob: * - """.format(name=section_name_with_num, - name_sub="=" * len(section_name_with_num)) + """.format(zfs_repo_url=zfs_repo_url, + section_num=section_num, + name=section_name_with_num, + name_sub="=" * len(section_name_with_num),) ) for page in section_pages: with open(os.path.join(rst_dir, page + '.rst'), "w") as f: f.write( - """ -.. THIS FILE IS AUTOGENERATED, DO NOT EDIT! + """.. THIS FILE IS AUTOGENERATED, DO NOT EDIT! + +:github_url: {zfs_repo_url}blob/master/man/man{section_num}/{name} {name} {name_sub} @@ -154,7 +161,8 @@ def run(in_dir, out_dir): .. raw:: html - """.format(name=page, + """.format(zfs_repo_url=zfs_repo_url, + name=page, build_dir=build_dir, section_num=section_num, name_sub="=" * len(page))