-
-
Notifications
You must be signed in to change notification settings - Fork 11
Code sharing between different training courses #18
Comments
@klieret, I was told to tag you, since you are the most likely candidate to have thought about this. 😄 |
Since opening this issue I have found out about Jekyll themes and how to create one. I have managed to move a lot of the assets and layouts in this repository into a theme, which could significantly reduce the amount of code duplication between projects; they could all just use this theme. If everyone agrees, I could create a repository for this theme and see if we can convert the existing trainings to it. 😃 |
Hi @stephenswat So far we have exactly copied the approach that the carpentries have taken: They use a repository "style repository" with all shared elements and use it as a template whenever they start a new module. The disadvantage is, as you mentioned that it's hard to pass on updates to all the modules. In our case this styles repository lives here: https://github.com/hsf-training/hsf-styles but I haven't updated it in a while. This should be kept up to date with its counter part from the carpentries (to which we made some adjustments) https://github.com/carpentries/styles I haven't done that in a while though :/ I will update our styles repository today and then create PRs for all the modules so that they are up to date. At one of the hackathons I also talked to @henryiii about better ways to do this. I think that using themes was also what he proposed. I currently don't have much time to look into this, but for me the only important thing is that we don't get cut away from changes from https://github.com/hsf-training/hsf-styles because they have many more people working on this. |
Thank you for the extensive answer, Kilian. I'd still like to see how far we can come with a Jekyll theme (keeping the |
Alright, so I read up a little bit on Jekyll themes and such, and I have come up with something that might work. If you check out https://github.com/stephenswat/hsf-training-cpp-webpage/tree/minimized, you will find my minimized version of this C++ training repository, which has the following two changes made:
I think the advantage of this approach is that there is simply a lot less code to maintain. By using this theme across trainings we would avoid a ton of work updating files whenever the base theme changes. The instructions for serving the site are slightly different (not not much more complicated, explained in the README), and serving this site is actually a lot faster. |
Thanks a lot for looking into this @stephenswat ! I agree that this is a much much nicer solution than the current one. It seems carpentries have actually discussed this: First brought up in this issue, then decided to reevaluate the decision in the future (source). This is probably the same as what you're doing, right? In order to keep the current workflow of starting a new module (which is to import the styles repo and then to run More importantly for maintenance though, we would have to split up the styles repository in two parts (one with the |
Looking at what the Carpentry people proposed in those issues, it looks rather similar, yes. Regarding the Regarding your second question, I think the ideal approach to all of this would be to have a minimum amount of content in the lessons themselves that would even need to be updated from the Carpentries. Looking at the branch I created as an example, there is already rather little there that is dependent on upstream updates: the |
I just asked the people from the carpentries why they didn't follow through with this theme based approach. Perhaps there were some reasons. |
Indeed this is looking quite promising. I just tried your minimized version and it worked flawlessly! So here's the path of migration that I currently see:
For maintenance:
|
Ah regarding So I think this actually still makes sense. |
I had to -gem 'hsf-training-theme', git: "https://github.com/stephenswat/hsf-training-theme.git"
+gem 'hsf-training-theme', git: "https://github.com/stephenswat/hsf-training-theme.git", branch: 'main' btw |
Hi @stephenswat : I now finally followed your approach and created There is still the issue of the few files that cannot be shared by this, but for that I will use Thanks a lot again for getting this started! Sorry that it took so long to make it happen... |
Hi Kilian, it's me who should be sorry for proposing this and not helping to implement it. 😉 Very glad to hear it has worked out! Great job! |
Looking at your repository (in particular your Gemfile) helped a lot! :) |
Just now I opened a merge request, #17, which deals with the way this course is built and served. That is to say, something outside of the content. This left me a little bit worried about the structure of the repositories of the HSF trainings in a more general sense. If I go to any of the other training repositories, the same issue is still there. Updating anything that is not directly related to the contents of one particular course requires you to mirror that change a dozen times! This seems like a potential recipe for disaster and unmaintainability in the future.
Have we put any thought into how we can maybe resolve this issue? To somehow deduplicate all the non-content files between the different trainings?
The text was updated successfully, but these errors were encountered: