-
-
Notifications
You must be signed in to change notification settings - Fork 294
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
Make featured notebook sources a frontend launch param #2412
Conversation
Try this Pull Request!Open Julia and type: julia> import Pkg
julia> Pkg.activate(temp=true)
julia> Pkg.add(url="https://github.com/fonsp/Pluto.jl", rev="featured-sources-as-index-launch-param")
julia> using Pluto |
// Option 2: configured through url and integrity strings | ||
(launch_params.featured_source_url | ||
? [{ url: launch_params.featured_source_url, integrity: launch_params.featured_source_integrity }] | ||
: // Option 3: default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pankgeorg You could add an option between 2 and 3 to overload the sources with those from juliahub. Something like:
// Option 1: configured directly
launch_params.featured_sources ??
// Option 2: configured through url and integrity strings
(launch_params.featured_source_url
? [{ url: launch_params.featured_source_url, integrity: launch_params.featured_source_integrity }]
: // Option 3: overloaded by environment
environment.featured_sources ??
// Option 4: default
default_featured_sources.sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this PR adds the launch_params.featured_sources
config, but for JH integration the environment
seems better suited, right?
How do we use this? I was thinking it would be an argument to I was hoping it could be used to present a series of read-only templates that people can save and then edit. |
@fonsp Just checking on this - is this parameter exposed to the |
Hey Nick! This is a "launch parameter" to the Pluto GUI, which is different from the The list of launch parameters is here:
There are three ways you can set the launch parameters:
For you use case, you probably want to generate a URL like I did in my original post and give that to people (use The JSON file is generated automatically by PlutoSliderServer since JuliaPluto/PlutoSliderServer.jl#68 . JuliaPluto/PlutoSliderServer.jl#100 makes it possible to run a website like featured.plutojl.org yourself, where you see an index page in the style of Pluto's main menu. Check out https://github.com/JuliaPluto/featured to learn more about frontmatter and |
Thanks for the all the details! I'm not great with JS/HTML so I'm struggling a bit. I'd rather not change what URL people use, I just want to provide a different default for the main page. Is it that the frontend can't really be modified by the server? Can I just change the source file, like |
Maybe you could just fork Pluto and edit the |
I'd rather not have to maintain a repo just for this. |
Alright, let me know if I can help in another way |
This is necessary to render the featured notebooks directly on our WIP website :)
You can test it:
This will show the regular index page, but with the notebooks from https://mit-c25.netlify.app/ as source! (These don't have images, because no image URLs are given in the frontmatters in that repository.)
Matching PlutoSliderServer PR: