Skip to content

Opening a Pluto notebook from the command line #2725

Discussion options

You must be logged in to vote

Here is mine (it's a bash function):

pluto() {
  PLUTO_ARGS="dismiss_update_notification=true, require_secret_for_open_links=true, require_secret_for_access=true"
  case "$2" in
      yes) REVISE="using Revise;" ;;
      *)   REVISE="" ;;
  esac
  if [[ -d "$HOME/Projects/Pluto.jl" ]]; then
    PLUTO_PROJECT=$HOME/Projects/Pluto.jl
  else
    PLUTO_PROJECT=@pluto
  fi
  julia --threads=auto --project=$PLUTO_PROJECT -e "
    $REVISE
    import Pluto;
    notebook_to_open = \"$1\"
    if length(notebook_to_open) == 0
      Pluto.run($PLUTO_ARGS)
    else
      @info \"opening notebook\" notebook_to_open
      Pluto.run(notebook=notebook_to_open, $PLUTO_ARGS)
    end
  "
}

It checks if the f…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by fonsp
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants