Skip to content
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

Test if Pluto initialized and running #186

Closed
cormullion opened this issue Jun 13, 2020 · 3 comments
Closed

Test if Pluto initialized and running #186

cormullion opened this issue Jun 13, 2020 · 3 comments

Comments

@cormullion
Copy link
Contributor

In reference to JuliaGraphics/Luxor.jl#90 (adding support for Pluto), is there a way to check whether Pluto is running? At the moment I run this for Jupyter:

(isdefined(Main, :IJulia) && Main.IJulia.inited) ? jupyter = true : jupyter = false

so want something similar for Pluto. Perhaps

(isdefined(Main, :PlutoRunner) 

might be sufficient - wonder if there's anything better?

@fonsp
Copy link
Owner

fonsp commented Jun 13, 2020

Hey!
Fun to hear from you! I actually wrote a workaround once to make Luxor work with Pluto - I will talk more about it in the issue that you mentioned.

About detecting whether you are in Pluto - this would work, but we don't really want this to be something that other packages rely upon, for two reasons.

First, we think that it should not be necessary. The only code that would need to specialize on the programming environment is display code and interaction code. Interaction code is a bit trickier (feel free to open an issue about it), but for display code: Julia has this very cool multimedia display system built in, and we want to use it!

Pluto's display system is a lot simpler than that of Juno and Jupyter - calling show or print from (package) just prints to the terminal (like in the REPL), and there are no internal systems to hook into. The only way to display something in Pluto is by having a cell return it. Rich output can be created by defining show methods for your types, for different MIME types.

The second reason is that Pluto is still in heavy development, including the runtime system, and we want to be free to make breaking changes in this area. (Breaking from the perspective of code for running in Pluto.) We want to find the right architecture before breaking it open for customization and specialized code.

Let's think together about the right solution for Luxor, I really want to make it work - it would be a very cool sample notebook!

@cormullion
Copy link
Contributor Author

Great, thanks!

@cormullion
Copy link
Contributor Author

Fixed by JuliaGraphics/Luxor.jl#91. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants