generalize the export script
This commit is contained in:
parent
3fb6028676
commit
e5623592cc
|
@ -33,6 +33,10 @@ function export_html(notebook_path, html_path)
|
|||
end
|
||||
end
|
||||
|
||||
# TODO: use loop cli args
|
||||
export_html("exos.jl", "exos.html")
|
||||
export_html("index.jl", "index.html")
|
||||
# get cli args
|
||||
for arg in ARGS
|
||||
filename, _ = splitext(arg)
|
||||
html_path = filename * ".html"
|
||||
println("Exporting $arg to $html_path")
|
||||
export_html(arg, filename * ".html")
|
||||
end
|
||||
|
|
11
flake.nix
11
flake.nix
|
@ -35,17 +35,16 @@
|
|||
];
|
||||
|
||||
buildPhase = ''
|
||||
# TODO: comment this shit
|
||||
# copy the notebooks, Pluto needs write permission
|
||||
cp $src/TP1/notebook.jl index.jl
|
||||
cp $src/TD/notebook.jl exos.jl
|
||||
chmod +w index.jl exos.jl
|
||||
|
||||
cp $src/export_html.jl export_html.jl
|
||||
# julia needs permission to create .julia directory
|
||||
export HOME=$TMPDIR
|
||||
|
||||
# https://github.com/NixOS/nix/issues/670#issuecomment-1211700127
|
||||
export HOME=$(pwd)
|
||||
|
||||
julia export_html.jl
|
||||
# run and export the notebooks
|
||||
julia $src/export_html.jl exos.jl index.jl
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
|
|
Loading…
Reference in a new issue