Open gdalle opened 1 year ago
the offending lines are
I suspect the eval
should be run in the page module, this one amounts to Main.eval(...)
.
could you try swapping this for lc.nb_code.mdl.eval(...)
? (I can try myself but am away from my dev laptop)
Nope, doesn't work, but no rush
Hmm :'(
this:
julia> module A
"""
abc
"""
foo(x) = 0
end
Main.A
help?> A.foo
abc
julia> A.eval("@doc foo")
"@doc foo"
julia> A.eval(Meta.parse("@doc foo"))
abc
works but there's likely something a bit subtle going on... might end up asking this one on Discourse, I don't understand well how docstrings are processed
It's not just about docstrings, I also have the issue with modules
hmm we're wading into tricky territory here in terms of how far Xranklin can go to make code execution inside a module look like the normal REPL, demoing pkg stuff is likely to be on the edge of that..
It looks like if the package is already in your dev path it should work though:
julia> lc = Xranklin.ToyLocalContext()
julia> s = """
```>
using Pkg
Pkg.develop(path="/Users/tlienart/.julia/dev/FP2")
using FP2
FP2.subs("abc", 2:3)
"""
julia> html(s, lc) |> println [ Info: ⏯️ evaluating cell auto_cell_1_1... [ Info: ⏯️ evaluating cell auto_cell_1_2... [ Info: ⏯️ evaluating cell auto_cell_1_3... [ Info: ⏯️ evaluating cell auto_cell_1_4...
julia> using Pkg
julia> Pkg.develop(path="/Users/tlienart/.julia/dev/FP2")
Resolving package versions...
Updating `~/.julia/dev/Xranklin/Project.toml`
[c78977f6] + FP2 v0.1.0 `~/.julia/dev/FP2`
Updating `~/.julia/dev/Xranklin/Manifest.toml`
[67c07d97] + Automa v1.0.1
[c78977f6] + FP2 v0.1.0 `~/.julia/dev/FP2`
julia> using FP2
julia> FP2.subs("abc", 2:3)
bc
maybe give me the full sequence of instructions here? if you take the users through a "create a package" step and then do as above it should work I think. But probably easier for me to try to reproduce this.
The full sequence of instructions is here: https://github.com/modernjuliaworkflows/modernjuliaworkflows.github.io/blob/main/pages/sharing/sharing.md And strangely it seems to work online.
Honestly at this point it's an extremely niche problem so I wouldn't worry too much
Source code:
This way, readers and users of your code can query them through the REPL help mode: