Developing Julia modules with Pluto

I noticed that in pluto notebooks, there are always 2 imported packages: Markdown and InteractiveUtils. But if we want to use those notebooks as modules, we really dont need them at all. Why they are not commented like the other cells in pluto notebooks?

3 Likes

I can imagine the situation that a variable is defined via a slider within a md block.
If you would omit the markdown dependency in the non-Pluto case the md doesn’t work anymore and you would need to extract the information from that.

So it might be possible but maybe not worth the trouble?

I prefer Pluto notebooks as simple example demonstrations of a proper package and since local packages are so easy to handle with Revise, I just load them from Pluto.

2 Likes

Yes, we can not remove markdown dependency, but the problem here is that we are importing them multiple times and it may lead to performance downgrade.

I think the effect on performance will be neglegible.


julia> @time for _ in 1:1000
           using Markdown
       end
  0.051686 seconds (170.99 k allocations: 15.396 MiB, 7.41% gc time)
1 Like