@@ -5,12 +5,13 @@ using Weave, Pkg, IJulia, InteractiveUtils, Markdown
55repo_directory = joinpath (@__DIR__ ," .." )
66cssfile = joinpath (@__DIR__ , " .." , " templates" , " skeleton_css.css" )
77latexfile = joinpath (@__DIR__ , " .." , " templates" , " julia_tex.tpl" )
8+ default_builds = (:script ,:html ,:github )
89
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)
1112 @info (" Weaving $(target) " )
1213
13- if isfile (joinpath (folder, " Project.toml" ))
14+ if isfile (joinpath (repo_directory, folder, " Project.toml" ))
1415 @info (" Instantiating" , folder)
1516 Pkg. activate (folder)
1617 Pkg. instantiate ()
@@ -54,22 +55,22 @@ function weave_file(folder,file,build_list=(:script,:html,:pdf,:github,:notebook
5455 end
5556end
5657
57- function weave_all ()
58+ function weave_all (build_list = default_builds )
5859 for folder in readdir (joinpath (repo_directory," tutorials" ))
5960 folder == " test.jmd" && continue
60- weave_folder (folder)
61+ weave_folder (folder,build_list )
6162 end
6263end
6364
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) )
6667 # Skip non-`.jmd` files
6768 if ! endswith (file, " .jmd" )
6869 continue
6970 end
7071
7172 try
72- weave_file (folder,file)
73+ weave_file (folder,file,build_list )
7374 catch e
7475 @error (e)
7576 end
124125
125126function open_notebooks ()
126127 Base. eval (Main, Meta. parse (" import IJulia" ))
128+ weave_all ((:notebook ,))
127129 path = joinpath (repo_directory," notebook" )
128130 IJulia. notebook (;dir= path)
129131end
0 commit comments