man pages: gen .in pages too

Some pages have replacing placeholders,
just render them as is for now.

Signed-off-by: George Melikov <mail@gmelikov.ru>
This commit is contained in:
George Melikov
2023-01-27 12:51:22 +03:00
parent b358f76d1b
commit e08d869fed

View File

@@ -84,16 +84,20 @@ def run(in_dir, out_dir):
out_section_dir = os.path.join(out_dir, build_dir, section) out_section_dir = os.path.join(out_dir, build_dir, section)
os.makedirs(out_section_dir, exist_ok=True) os.makedirs(out_section_dir, exist_ok=True)
for page in os.listdir(os.path.join(subdir, section)): for page in os.listdir(os.path.join(subdir, section)):
if not page.endswith(section_suffix): if not (page.endswith(section_suffix) or
page.endswith(section_suffix + '.in')):
continue continue
LOG.debug('Generate %s page', page) LOG.debug('Generate %s page', page)
pages[section_num].append(page) stripped_page = page.rstrip('.in')
page_file = os.path.join(out_section_dir, page + '.html') page_file = os.path.join(out_section_dir,
stripped_page + '.html')
with open(page_file, "w") as f: with open(page_file, "w") as f:
subprocess.run( subprocess.run(
['mandoc', '-T', 'html', '-O', 'fragment', ['mandoc', '-T', 'html', '-O', 'fragment',
os.path.join(subdir, section, page)], stdout=f, os.path.join(subdir, section, page)], stdout=f,
check=True) check=True)
pages[section_num].append(stripped_page)
break break
man_path = os.path.join(out_dir, man_section_dir) man_path = os.path.join(out_dir, man_section_dir)