@@ -5,12 +5,13 @@ using Weave, Pkg, IJulia, InteractiveUtils, Markdown
5
5
repo_directory = joinpath (@__DIR__ ," .." )
6
6
cssfile = joinpath (@__DIR__ , " .." , " templates" , " skeleton_css.css" )
7
7
latexfile = joinpath (@__DIR__ , " .." , " templates" , " julia_tex.tpl" )
8
+ default_builds = (:script ,:html ,:github )
8
9
9
- function weave_file (folder,file,build_list= ( :script , :html , :pdf , :github , :notebook ) )
10
- target = joinpath (folder, file)
10
+ function weave_file (folder,file,build_list= default_builds )
11
+ target = joinpath (repo_directory, " tutorials " , folder, file)
11
12
@info (" Weaving $(target) " )
12
13
13
- if isfile (joinpath (folder, " Project.toml" ))
14
+ if isfile (joinpath (repo_directory, folder, " Project.toml" ))
14
15
@info (" Instantiating" , folder)
15
16
Pkg. activate (folder)
16
17
Pkg. instantiate ()
@@ -54,22 +55,22 @@ function weave_file(folder,file,build_list=(:script,:html,:pdf,:github,:notebook
54
55
end
55
56
end
56
57
57
- function weave_all ()
58
+ function weave_all (build_list = default_builds )
58
59
for folder in readdir (joinpath (repo_directory," tutorials" ))
59
60
folder == " test.jmd" && continue
60
- weave_folder (folder)
61
+ weave_folder (folder,build_list )
61
62
end
62
63
end
63
64
64
- function weave_folder (folder)
65
- for file in readdir (folder)
65
+ function weave_folder (folder,build_list = default_builds )
66
+ for file in readdir (joinpath (repo_directory, " tutorials " , folder) )
66
67
# Skip non-`.jmd` files
67
68
if ! endswith (file, " .jmd" )
68
69
continue
69
70
end
70
71
71
72
try
72
- weave_file (folder,file)
73
+ weave_file (folder,file,build_list )
73
74
catch e
74
75
@error (e)
75
76
end
124
125
125
126
function open_notebooks ()
126
127
Base. eval (Main, Meta. parse (" import IJulia" ))
128
+ weave_all ((:notebook ,))
127
129
path = joinpath (repo_directory," notebook" )
128
130
IJulia. notebook (;dir= path)
129
131
end
0 commit comments