MCPcopy Create free account
hub / github.com/DFHack/dfhack / write_tool_docs

Function write_tool_docs

conf.py:70–82  ·  view source on GitHub ↗

Creates a file for each tool with the ".. include::" directives to pull in the original documentation.

()

Source from the content-addressed store, hash-verified

68
69
70def write_tool_docs():
71 """
72 Creates a file for each tool with the ".. include::" directives to pull in
73 the original documentation.
74 """
75 for k in doc_all_dirs():
76 label = ('.. _{name}:\n\n').format(name=k[0])
77 include = ('.. include:: /{path}\n\n').format(path=k[1])
78 os.makedirs(os.path.join('docs/tools', os.path.dirname(k[0])),
79 mode=0o755, exist_ok=True)
80 with write_file_if_changed('docs/tools/{}.rst'.format(k[0])) as outfile:
81 outfile.write(label)
82 outfile.write(include)
83
84
85write_tool_docs()

Callers 1

conf.pyFile · 0.85

Calls 4

write_file_if_changedFunction · 0.90
doc_all_dirsFunction · 0.85
formatMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected