Using a local module file #1728
-
|
I have made a simple module file, myModule.jl in the same folder as the Pluto notebook. This module exports a function called myFunction. In the first cell I have: And in the next cell:
After I Shift+Enter that, I get this error: ... But now if I go back to the top cell and just do Shift+Enter, the second cell shows the correct result. To sum up,..After entering myFunction into any cell (or after doing Shift+Enter in an existing cell ) I need to go back to the first cell and do a Shift+Enter again to refresh the module's exports. I'm working around this by putting Is this a bug or is there something I can do to to make it work? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
|
Hey @MinusOneTwelfth-1! As far as I can tell, 1. Create a skeleton packagePkgTemplates.jl is awesome for this, and super customizable: pkg> add PkgTemplates
julia> using PkgTemplates
julia> Template(dir=".")("MyPkg") # This assumes you have your global git configured already2. Add
|
Beta Was this translation helpful? Give feedback.
-
|
hey there, this does not seem to work for me anymore. I get this it seems the |
Beta Was this translation helpful? Give feedback.
Hey @MinusOneTwelfth-1! As far as I can tell,
include[t]ing things in Pluto can get a bit dicey sometimes. When I get to the stage of working with modules, I usually just turn what I am working on into a package, which makes a lot of really nice things automatically available, such as the Revise.jl workflow. Using your example above, I would do something like the following:1. Create a skeleton package
PkgTemplates.jl is awesome for this, and super customizable:
2. Add
Revise.jlglobally(or just to your new package, up to you)
pkg> add Revise3. Fi…