Skip to content

Commit

Permalink
Merge pull request #37 from timlinux/docs
Browse files Browse the repository at this point in the history
Fix python docstring parser
  • Loading branch information
timlinux authored Aug 21, 2023
2 parents 84412c3 + 779027c commit 5b625b1
Show file tree
Hide file tree
Showing 4 changed files with 375 additions and 20 deletions.
34 changes: 18 additions & 16 deletions docs/python_manual_hook.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import logging
import mkdocs.plugins
import os

log = logging.getLogger('mkdocs')

@mkdocs.plugins.event_priority(-50)


def on_startup(command, dirty):


template = """
---
title: Automatically Generated Python Documentation
Expand All @@ -23,21 +21,25 @@ def on_startup(command, dirty):
"__init__",
"migrations",
"tests"]

for root, dirs, files in os.walk("../django_project"):
for file in files:
file = os.path.join(root, file)
if file.endswith(".py"):
ignored = False;
for item in ignore_list:
if item in file:
ignored = True;
#print (item, file, ignored)
if not ignored:
file = file.replace("../django_project/", "::: ")
file = file.replace("/", ".")
file = file.replace(".py", "")
template = template + file + "\n"
file = open("src/developer/manual/index.md","wt")
file = os.path.join(root, file)
ignored = False;
if file.endswith(".py"):
for item in ignore_list:
if item in file:
ignored = True;
#print (item, file, ignored)
if not ignored:
file = file.replace("../django_project/", "::: ")
file = file.replace("/", ".")
file = file.replace(".py", "")
template = template + file + "\n"
output_path = os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"src/developer/manual/index.md")
log.info("Manual will be written to: " + output_path)
file = open(output_path,"wt+")
file.write(template)
file.close()
log.info("Manual written to: " + os.path.realpath(file.name))
Binary file added docs/src/developer/api/guide/img/concepts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5b625b1

Please sign in to comment.