diff --git a/export_html.jl b/export_html.jl
index c6581ed..17d39c3 100644
--- a/export_html.jl
+++ b/export_html.jl
@@ -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
diff --git a/flake.nix b/flake.nix
index 062a5fa..bcdb0b6 100644
--- a/flake.nix
+++ b/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 = ''