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

Adding package version summary table #252

Open
stefanbringuier opened this issue Apr 25, 2023 · 2 comments
Open

Adding package version summary table #252

stefanbringuier opened this issue Apr 25, 2023 · 2 comments

Comments

@stefanbringuier
Copy link

I export most of my pluto notebooks to HTML and I know that the package install log, which includes the version info, can be seen by clicking on the check-mark and showing the terminal output. However, if there are a lot of packages, it would be much easier to just see the package versions in one place. Especially when I'm working off a notebook and want to see which packages and versions I used.

To do this, I created a draft approach to create such visual widget:

image

Here is the associated notebook: https://github.com/stefanbringuier/randomonium/blob/main/notebooks/PackageVersionUI.jl

The table is collapsible and tried to include a refresh button, although I don't think it's working.

I haven't made any attempt to keep aligned with the PlutoUI styles, but just wanted to know if something like this would be incorporated into PlutoUI. It would be nice to just import PlutoUI and call PackageList, for example. If there is interest, could anyone help with improving on the style and approach, since my knowledge of HTML/CSS/JavaScript is limited.

@fonsp
Copy link
Member

fonsp commented Apr 26, 2023

Nice! I wonder what the best place to publish it would be. How do you feel about registering a package for this widget? I personally think that small packages are fantastic, and we should make them more often!

Some notes:

  • This would be a really good place to use HypertextLiteral.jl instead of HTML, join, etc. Try it out!
  • This widget probably also works (and would be useful!) in Jupyter, Franklin, Documenter, Olive.jl, etc,
  • Is the goal of the refresh button to re-run all cells that contain using?
    • If the goal is to refresh the contents of the table (to match the current Pkg environment), then you need to find the current cell (in which the widget is displayed) with currentScript.closest("pluto-cell"). The use .querySelector to find the "Run" button, and .click() it. But this is not officially supported API, you would need to wait for Direct communication link between user JS and JL for JSServe support fonsp/Pluto.jl#2392 for that.
    • It looks like you might not know about the Chrome/Firefox devtools to let you debug your JS code. Check out the JavaScript featured notebook in the Pluto main menu to learn how to do this!

@fonsp fonsp changed the title Adding package version widget Adding package version summary table Apr 26, 2023
@stefanbringuier
Copy link
Author

Thanks reply and all the stuff you do for the community!

Nice! I wonder what the best place to publish it would be. How do you feel about registering a package for this widget?

I have no reservations against making it a registered package, just wasn't sure and wanted to get a consensus. Could it sit under the JuliaPluto org?

  • This would be a really good place to use HypertextLiteral.jl instead of HTML, join, etc. Try it out!

Hmm, good point, will do.

  • This widget probably also works (and would be useful!) in Jupyter, Franklin, Documenter, Olive.jl, etc,

Yeah, I would think so. I do know that PlutoStaticHTML.jl will grab the packages and versions with:

julia> oopts = OutputOptions(; append_build_context=true);
...
julia> build_notebooks(bopts, files, oopts)
[...]

and then this resulting HTML notebook files can be used with Franklin or Documenter.

  • Is the goal of the refresh button to re-run all cells that contain using?

Yes, that's the idea. I'll keep an eye on the issue you reference and thanks for the pointers on the dev tools and notebook for JS since I'm not aware of these.

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