JuliaPluto / featured

https://featured.plutojl.org
12 stars 9 forks source link

Adapting for Personal Templates #11

Closed stefanbringuier closed 2 months ago

stefanbringuier commented 1 year ago

I just forked this repo and have been trying to use it as a way to have the frontend load my custom Pluto notebook templates.

All the GitHub actions pass and I followed the details in the pluto-developer-instructions.

The problem is I don't see any nb cards/entries (only 1 right now):

https://stefanbringuier.github.io/PlutoNotebookTemplates/

And same on my local Pluto server instance:

image

Everything looks correct to me on the dist branch: https://github.com/stefanbringuier/PlutoNotebookTemplates/tree/dist

This would be very helpful for me as I have a lot of template nb files that would be nice to quickly select from the landing page.

Pangoraw commented 1 year ago

You need to add a tag in the notebooks' frontmatter:

https://github.com/JuliaPluto/featured/blob/a004fdb6fc31c8e9fadc511e127c957fe9647415/src/basic_templates/BasicPlutoTemplate.jl#L12

which corresponds to one of the tags of the categories defined in the json config file (example: basic_templates or specific_templates)

https://github.com/JuliaPluto/featured/blob/a004fdb6fc31c8e9fadc511e127c957fe9647415/src/pluto_export_configuration.json#L10

stefanbringuier commented 1 year ago

Worked! Thanks for catching this for me.

stefanbringuier commented 2 months ago

Seems I have forgotten or can't get my personal templates showing up on Pluto's landing page leveraging featured notebooks repo. I have a local copy of pluto where I modify the frontend/featured_sources.js and follow the developer instructions for updating the featured notebooks to have them displayed but I can't get it to work again.

Any guidance or laid out steps for this would be much appreciated.

Also would templates like these be suitable for contribution? In general would be nice if I could easily incorporate my templates without having to modify and run a cloned branch of Pluto.

fonsp commented 2 months ago

Hi! I just added your export json to featured_sources.json and it seems to work. See the green lines on the left to see which lines are different from the main branch of Pluto

image
fonsp commented 2 months ago

You can also start Pluto normally and go to:

http://localhost:1234/?featured_source_url=https%3A%2F%2Fstefanbringuier.github.io%2FPlutoNotebookTemplates%2Fpluto_export.json 

(I used https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent to encode the url)

fonsp commented 2 months ago

About contributing: maybe a sample notebook about PlutoExtras might be better? But I think some PlutoExtras featured need polishing before

stefanbringuier commented 2 months ago

You can also start Pluto normally and go to:

http://localhost:1234/?featured_source_url=https%3A%2F%2Fstefanbringuier.github.io%2FPlutoNotebookTemplates%2Fpluto_export.json 

(I used https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent to encode the url)

This is perfect! Thanks Fons.

Closing again.