Skip to content

Commit bcc1587

Browse files
committed
test
1 parent a069d88 commit bcc1587

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/BuildMKDocsAndPublishToGithubPages.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,6 @@ jobs:
4646
# https://github.com/marketplace/actions/deploy-mkdocs#building-with-github_token
4747
# The token is automatically generated by the GH Action
4848
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
49-
BASE_DIRECTORY: docs
49+
BASE_DIRECTORY: docs/
5050
CONFIG_FILE: docs/mkdocs.yml
5151
REQUIREMENTS: docs/requirements.txt

docs/python_manual_hook.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import logging
2-
import mkdocs.plugins
32
import os
4-
log = logging.getLogger('mkdocs')
53

6-
@mkdocs.plugins.event_priority(-50)
4+
import mkdocs.plugins
75

6+
log = logging.getLogger('mkdocs')
87

9-
def on_startup(command, dirty):
108

9+
@mkdocs.plugins.event_priority(-50)
10+
def on_startup(command, dirty):
1111
template = """
1212
---
1313
title: Automatically Generated Python Documentation
@@ -21,7 +21,9 @@ def on_startup(command, dirty):
2121
"__init__",
2222
"migrations",
2323
"tests"]
24-
for root, dirs, files in os.walk("../django_project"):
24+
BASE_DIR = os.getenv('BASE_DIRECTORY', '')
25+
print(os.path.join(BASE_DIR, "../django_project"))
26+
for root, dirs, files in os.walk(os.path.join(BASE_DIR, "../django_project")):
2527
for file in files:
2628
file = os.path.join(root, file)
2729
ignored = False;
@@ -35,6 +37,8 @@ def on_startup(command, dirty):
3537
file = file.replace("/", ".")
3638
file = file.replace(".py", "")
3739
template = template + file + "\n"
38-
file = open("src/developer/manual/index.md","wt")
40+
file = open(
41+
BASE_DIR + "src/developer/manual/index.md", "wt"
42+
)
3943
file.write(template)
4044
file.close()

0 commit comments

Comments
 (0)