mirror of
https://github.com/mdbtools/mdbtools.git
synced 2026-03-03 17:08:31 +08:00
apidocs with doxygen
This commit is contained in:
38
api_docx/pre_build.py
Executable file
38
api_docx/pre_build.py
Executable file
@@ -0,0 +1,38 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import os
|
||||
|
||||
ROOT_PATH = os.path.abspath( os.path.join(os.path.dirname( __file__ ), ".."))
|
||||
|
||||
|
||||
files = os.listdir(os.path.join(ROOT_PATH, "doc"))
|
||||
|
||||
index = []
|
||||
for fname in sorted(files):
|
||||
if not fname.endswith(".txt"):
|
||||
continue
|
||||
cmd_name = fname[:-4]
|
||||
with open(os.path.join(ROOT_PATH, "doc", fname), "r") as f:
|
||||
contents = f.read()
|
||||
f.close()
|
||||
|
||||
out_file = os.path.join(ROOT_PATH, "temp-man-pages", "%s.md" % cmd_name)
|
||||
with open(out_file, "w") as f:
|
||||
s = "# %s {#%s}\n\n```\n%s\n```\n" % (cmd_name, cmd_name, contents)
|
||||
f.write(s)
|
||||
f.close()
|
||||
index.append(cmd_name)
|
||||
print(" wrote %s" % out_file)
|
||||
|
||||
out_file = os.path.join(ROOT_PATH, "temp-man-pages", "index.md")
|
||||
|
||||
s = "Man Pages {#man-pages}\n"
|
||||
s += "=========================\n\n"
|
||||
for page in index:
|
||||
s += "- @subpage %s\n" % page
|
||||
s += "\n"
|
||||
|
||||
with open(out_file, "w") as f:
|
||||
f.write(s)
|
||||
f.close()
|
||||
Reference in New Issue
Block a user