computational-thinking
computational-thinking copied to clipboard
Refactor to simplify and automate more
In this rewrite, the entire process to generate the site will be done by one script (written as a Pluto notebook, of course), instead of a combination of manual scripts, CI Julia scripts and Franklin. Right now it doesn't use Franklin at all anymore, but I might add back Franklin to process markdown files.
This makes it easier to set up a fork of the website, since the whole system now uses the same book_model.json file as input (describing the list of notebooks in the sidebar).
The notebook to generate the site can also be used to run and test it locally, and this local version now includes HTML exports of notebooks (before, you had to trust that the github CI would work properly) and can partially update automatically. It will be easy to add local support for the slider server later.
Eventually, the hope is that you can edit the course page by directly editing the sidebar on the left. That will probably be a separate project
Try it
Update Pluto and run the notebook in newwebsite/generate.jl.
Just in case other people are playing with this.
I adapted the GHA workflow (along with some necessary adjustments) in a fork of this repository https://github.com/greimel/18S191-reduced/blob/main/.github/workflows/ExportNotebooks.yml
https://greimel.github.io/18S191-reduced/notebooks_week12_how_to_collaborate_on_software/
Unfortunately, it doesn't have a landing page yet. Nor does it have pages that do not come from Pluto notebooks. (EDIT)
I adapted Fons' generate.jl notebook to handle plain markdown pages (via Franklin.jl). It works fine to deploy to github pages https://greimel.github.io/18S191-reduced/ - but the preview within the notebook doesn't work anymore. (EDIT)
Error encountered when trying to play with the branch. Should I update the versions of the packages?
This question sounds bit stupid. Should I use all the materials in newwebsite folder? I've tried open the generate.jl file in Pluto and got bunch of errors.
@delphinH @likanzhan The code in https://github.com/greimel/18S191-reduced should work fine.
Instructions
- Put your notebooks in the
notebooks/folder - update
newwebsite/book_model_small.json - Put any pure md files in
website/ - Run the
newwebsite/generate.jlnotebook in Pluto
The code should work fine for local preview and deployment on github pages.
@fonsp I think the code in my fork is pretty much ready to be turned into a template repo. I am hesitant to set it up myself, since it is essentially your code. How do you suggest to proceed?
Thanks, @greimel, that would be great.
When I run the the template you reduced, I got the following error
It seems that the version of PlutoSliderServer in the newwebsite project is outdated.
My question is is there a specifically reason we continue use the old format of Pluto, i.e., using Pkg.activate("."); Pkg.instantiate(), rather than using using ... (the modern way of using Pluto) directly ?
If we need to stick to the old mode, my second question is should I update the versions of Pluto and PlutoSliderServer in the newwebsite project or is there some other way so I can correct the error?
Thanks.
Likan
I don't think that this would make a difference, since the manifest has been added to the repo.
Probably there are Pkg server issues?
I turned this PR into a template repository (see the website this template generates)
Instructions (see also the README in the template repo)
- Put your notebooks in the
notebooks/folder - update
newwebsite/book_model_small.json - Put any pure md files in
website/ - Run the
newwebsite/generate.jlnotebook in Pluto
The code should work fine for local preview and deployment on github pages.
Superseded by #124