New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Pkg mode #39
Comments
Yea I have thought about that too. And same with |
Shell mode via |
On second thought, this would deviate from one of the original ideas with the package, that the source files should be valid julia code. There exist functional API's for Pkg, docs and shell so maybe better to use those? Also, why do you want to invoke Pkg in the files? Would it be better with an option to instantiate a provided Project.toml and running the script in that environment instead? |
There are various reasons you might want to do this, for example if you want to make notebook-based tutorials for the package manager. I take the point about valid Julia code, but having this certainly doesn't prevent people from doing that, and given the various issues with notebooks it's reasonable to want to use Literate even if notebooks are the only valid target. To elaborate a bit on our particular use case: We are doing exactly what you suggest, but just automating the process by adding |
Fair enough, although I wouldn't call
a "non-standard way" of using the package manager, it is actually the prefered method of using Pkg in scripts. Using IMO the first one is much more clear on what is going on. Note also that you can't copy-paste e.g. |
You can also use the Pkg string macro |
Right, that kinda emulates the |
My personal opinion is that it is quite nice that Literate files are actual julia files. Also, the API of Pkg is arguably the "official" way of interacting with the package manager from scripts while the REPL mode is for interactive use and tries to have a "do what I mean" philosophy. |
Lines beginning with
]
could be considered "Pkg mode" and evaluated as if in that repl mode; this follows what IJulia does when this is in a cell. Currently this just causes an error.cc @dhairyagandhi96
The text was updated successfully, but these errors were encountered: