2
2
Controllers related to showing Mathics3 documentation inside Django
3
3
"""
4
4
5
+ import logging
5
6
from copy import copy
6
7
from typing import Union
7
8
@@ -31,12 +32,13 @@ def check_for_pymathics_load():
31
32
print ("XXX refresh pymathics doc" , pymathics_modules )
32
33
new_modules = pymathics_modules - seen_pymathics_modules
33
34
for new_module in new_modules :
34
- title , _ = get_module_doc ( new_module )
35
+ print ( "loading " , new_module )
35
36
mathics3_module_part = documentation .parts_by_slug .get (
36
37
"mathics3-modules" , None
37
38
)
38
39
# If this is the first loaded module, we need to create the Part
39
40
if mathics3_module_part is None :
41
+ logging .warn ("Mathics3 Module Part not loaded. Loading it" )
40
42
mathics3_module_part = self .doc_part (
41
43
"Mathics3 Modules" ,
42
44
pymathics_modules ,
@@ -46,25 +48,15 @@ def check_for_pymathics_load():
46
48
seen_pymathics_modules = copy (pymathics_modules )
47
49
return
48
50
49
- # The part already exists. Lets add the new chapter.
50
-
51
- chapter = mathics3_module_part .doc .gather_chapter_doc_fn (
52
- mathics3_module_part ,
53
- title ,
54
- mathics3_module_part .doc ,
55
- )
56
- from trepan .api import debug
57
-
58
- debug ()
59
- submodule_names_seen = set ()
60
- chapter .doc .doc_chapter (
51
+ # The "Mathics3 modules" part already exists. Lets add the new chapter.
52
+ print ("loading the new chapter" )
53
+ chapter = documentation .doc_chapter (
61
54
new_module ,
62
55
mathics3_module_part ,
63
- pymathics_builtins_by_module ,
64
- seen_pymathics_modules ,
65
- submodule_names_seen ,
56
+ pymathics_builtins_by_module
66
57
)
67
- chapter .get_tests ()
58
+ mathics3_module_part .chapters .append (chapter )
59
+
68
60
seen_pymathics_modules = copy (pymathics_modules )
69
61
pass
70
62
0 commit comments