mirror of
https://github.com/dwinkler1/np.git
synced 2026-02-19 22:40:57 -05:00
added pluto notebooks
This commit is contained in:
parent
46ef4ce5f1
commit
7f8b3a491a
1 changed files with 20 additions and 4 deletions
|
|
@ -42,7 +42,7 @@
|
||||||
defaultPackageName = "p";
|
defaultPackageName = "p";
|
||||||
## Enable languages
|
## Enable languages
|
||||||
enabledLanguages = {
|
enabledLanguages = {
|
||||||
julia = false;
|
julia = true;
|
||||||
python = false;
|
python = false;
|
||||||
r = false;
|
r = false;
|
||||||
};
|
};
|
||||||
|
|
@ -387,7 +387,7 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
m = let
|
marimo = let
|
||||||
marimoInit = ''
|
marimoInit = ''
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
if [[ ! -f "pyproject.toml" ]]; then
|
if [[ ! -f "pyproject.toml" ]]; then
|
||||||
|
|
@ -464,7 +464,22 @@
|
||||||
enable = config.enabledLanguages.julia;
|
enable = config.enabledLanguages.julia;
|
||||||
path = {
|
path = {
|
||||||
value = "${pkgs.julia-bin}/bin/julia";
|
value = "${pkgs.julia-bin}/bin/julia";
|
||||||
args = ["--add-flags" "--project=. -e 'using Pkg; Pkg.instantiate()'"];
|
args = ["--add-flags" "--project=. -e 'using Pkg; Pkg.instantiate(); Pkg.add(\"Pluto\")'"];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
pluto = let
|
||||||
|
runPluto = ''
|
||||||
|
import Pkg; import TOML; Pkg.instantiate();
|
||||||
|
if !isfile("Project.toml") || !haskey(TOML.parsefile(Base.active_project())["deps"], "Pluto")
|
||||||
|
Pkg.add("Pluto");
|
||||||
|
end
|
||||||
|
import Pluto; Pluto.run();
|
||||||
|
'';
|
||||||
|
in {
|
||||||
|
enable = config.enabledLanguages.julia;
|
||||||
|
path = {
|
||||||
|
value = "${pkgs.julia-bin}/bin/julia";
|
||||||
|
args = ["--add-flags" "--project=. -e '${runPluto}'"];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
r = {
|
r = {
|
||||||
|
|
@ -518,8 +533,9 @@
|
||||||
shellCmds = pkgs.lib.concatLines (pkgs.lib.filter (cmd: cmd != "") [
|
shellCmds = pkgs.lib.concatLines (pkgs.lib.filter (cmd: cmd != "") [
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.r " - ${config.defaultPackageName}-r: Launch R console")
|
(pkgs.lib.optionalString config.enabledLanguages.r " - ${config.defaultPackageName}-r: Launch R console")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.julia " - ${config.defaultPackageName}-jl: Launch Julia REPL")
|
(pkgs.lib.optionalString config.enabledLanguages.julia " - ${config.defaultPackageName}-jl: Launch Julia REPL")
|
||||||
|
(pkgs.lib.optionalString config.enabledLanguages.julia " - ${config.defaultPackageName}-pluto: Launch Pluto.jl notebook")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.julia " - ${config.defaultPackageName}-initJl: Init existing Julia project")
|
(pkgs.lib.optionalString config.enabledLanguages.julia " - ${config.defaultPackageName}-initJl: Init existing Julia project")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-m: Launch Marimo notebook")
|
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-marimo: Launch Marimo notebook")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-py: Launch IPython REPL")
|
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-py: Launch IPython REPL")
|
||||||
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-initPython: Init python project")
|
(pkgs.lib.optionalString config.enabledLanguages.python " - ${config.defaultPackageName}-initPython: Init python project")
|
||||||
" "
|
" "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue