1
1
import logging
2
- import mkdocs .plugins
3
2
import os
4
- log = logging .getLogger ('mkdocs' )
5
3
6
- @ mkdocs .plugins . event_priority ( - 50 )
4
+ import mkdocs .plugins
7
5
6
+ log = logging .getLogger ('mkdocs' )
8
7
9
- def on_startup (command , dirty ):
10
8
9
+ @mkdocs .plugins .event_priority (- 50 )
10
+ def on_startup (command , dirty ):
11
11
template = """
12
12
---
13
13
title: Automatically Generated Python Documentation
@@ -21,7 +21,9 @@ def on_startup(command, dirty):
21
21
"__init__" ,
22
22
"migrations" ,
23
23
"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" )):
25
27
for file in files :
26
28
file = os .path .join (root , file )
27
29
ignored = False ;
@@ -35,6 +37,8 @@ def on_startup(command, dirty):
35
37
file = file .replace ("/" , "." )
36
38
file = file .replace (".py" , "" )
37
39
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
+ )
39
43
file .write (template )
40
44
file .close ()
0 commit comments