I'm a bit lost when trying to use MkDocs-gen-files to build my doc site. Can I ask if you are keen to point out what mistakes I made?
Currently I have the following code in docs/generate.py
import os
import mkdocs_gen_files
def process_file(filename):
with open(filename) as f:
content = f.read()
# headline_index = 0
# for line in content:
# if line.startswith("# "):
# break
# headline_index += 1
# content = content[headline_index:]
filename = os.path.dirname(filename.removeprefix("multimolecule/")) + ".md"
with mkdocs_gen_files.open(filename, "w") as file:
print(content, file=file)
mkdocs_gen_files.set_edit_path(filename, "gen_pages.py")
for root, _dirs, files in os.walk("multimolecule/models"):
if "README.md" in files:
process_file(os.path.join(root, "README.md"))
I have inspected that all files are successfully generated under mkdocs_gen_files.directory. But they are missing from then since.
Hi,
Thank you for this work!
I'm a bit lost when trying to use MkDocs-gen-files to build my doc site. Can I ask if you are keen to point out what mistakes I made?
Currently I have the following code in
docs/generate.py
I have inspected that all files are successfully generated under
mkdocs_gen_files.directory
. But they are missing from then since.You can find my full code at:
https://github.com/DLS5-Omics/multimolecule/tree/autodoc
The command I used to build the docs is
mkdocs build -f docs/mkdocs.yml