PkgManager: Allow loading of extensions specifically designed for pluto, implicitly
Some packages want to provide Pluto renderers, but only if the code runs inside Pluto. These renderers may be quite heavy and ideally wouldn't be loaded by any user of the library (e.g. MTK). It would be nice for Pkg to be able to detect Pluto (or, more likely, the PlutoRunner module) and load the extensions that are registered for a Pluto environment.
One important caveat is that we can't just slap PlutoRunner to the Manifest; as the file should also run independently (without loading the extension, as it does now). So this is really a "runtime" check.
Can you also write how this compares to https://plutojl.org/en/docs/abstractplutodingetjes/#is_inside_pluto ?
Pkg would handle it. It would "install and load the package" when inside pluto. Roughly equivalent to
function Base.show(io, ...)
if is_inside_pluto(io::IO) && !isdefined(:PlutoRunner, LatexifyPlutoExt)
Pkg.add("LatexifyPlutoExt")
using LatexifyPlutoExt
end
but if it's possible to do natively (and avoid opting out of the pkg manager) that would be even nicer)
I'm struggling actually creating an extension, but if someone can test if
[weakdeps]
PlutoRunner = "dc6b355a-2368-4481-ae6d-ae0351418d79"
[extensions]
YourExtensionForPluto = "PlutoRunner"
loads YourExtensionForPluto when in Pluto, that's pretty much done