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

Script to automate rendering webpages [ 🚨work-in-progress 🚨] #81

Merged
merged 14 commits into from
Jan 24, 2020

Conversation

TomKellyGenetics
Copy link
Member

Wrapper script to implement subroutines

Had a quick hack on the script to automate the technical side. Basically the aim here is to implement the workflows discussed in the READMEs (although I'd keep those to document what these do). This version has flags to --create for new lessons (which works on make-novice) and --import to pull existing lessons for contributions.

Plan is to add options to render webpages and (hopefully) merge updated English lessons to make things easier for maintainers / moderators in the future. Once that works we can try calling the script with Travis CI to push webpages to github when a commit it merged.

### example
# sh wrapper.sh --repo make-novice --create
# sh wrapper.sh --repo make-novice --import

# create (implemented):      subroutine to create new PO files from an English lesson not currently being translated
# import (testing):          subroutine to pull a lesson being translated from remote to make changes locally
# render (work-in-progress): subroutine to render webpages from current PO files and export Japanese lessons to remote repos
# update (to-do later):      subroutine to pull updates from remote English lesson and merge based on archived ancestor (only new sections need to be translated)

@TomKellyGenetics
Copy link
Member Author

At the moment user information is automatically detected from your PC and git config --global settings. I'll think about how to make it optional to pass different user accounts.

@TomKellyGenetics
Copy link
Member Author

The --create arg will edit the headers so something is there and the po4gitbook/compile.sh will run. At the moment --import won't update these to the current user. This just prepares the files so manually editing and submitting a PR but we could automate changing headers. I've added checking the dates are the current year which will fix the bug we had.

@TomKellyGenetics TomKellyGenetics self-assigned this Jan 23, 2020
@TomKellyGenetics TomKellyGenetics added the enhancement New feature or request label Jan 23, 2020
@TomKellyGenetics
Copy link
Member Author

@rikutakei @joelnitta On second thoughts, don't "review" this as it will trigger mergify #79 #80

@TomKellyGenetics TomKellyGenetics added the work-in-progress Proposal for a feature in development, don't merge label Jan 23, 2020
@TomKellyGenetics TomKellyGenetics changed the title Script to automate rendering webpages [work-in-progress] Script to automate rendering webpages [ 🚨work-in-progress 🚨] Jan 23, 2020
@TomKellyGenetics TomKellyGenetics changed the title Script to automate rendering webpages [ 🚨work-in-progress 🚨] Script to automate rendering webpages [ 🚨work-in-progress 🚨] Jan 23, 2020
@TomKellyGenetics TomKellyGenetics changed the title Script to automate rendering webpages [ 🚨work-in-progress 🚨] Script to automate rendering webpages \n [ 🚨work-in-progress 🚨] Jan 23, 2020
@TomKellyGenetics TomKellyGenetics changed the title Script to automate rendering webpages \n [ 🚨work-in-progress 🚨] Script to automate rendering webpages \ \ \ \ \ \ \ [ 🚨work-in-progress 🚨] Jan 23, 2020
@TomKellyGenetics TomKellyGenetics changed the title Script to automate rendering webpages \ \ \ \ \ \ \ [ 🚨work-in-progress 🚨] Script to automate rendering webpages [ 🚨work-in-progress 🚨] Jan 23, 2020
@joelnitta
Copy link
Member

Thanks Tom! I think this is good to go for now, with the expectation that more edits will be necessary as it's WIP.

@joelnitta joelnitta merged commit d85e340 into swcarpentry-ja:ja Jan 24, 2020
@rikutakei
Copy link
Collaborator

Thanks Tom, will have a look through and try to get a grasp of the whole process!

@TomKellyGenetics
Copy link
Member Author

Thanks, not sure how to go about calling it on the main repo (and let's leave merging updated English lessons for now). Not sure what "user" it would be if the organisation calls it on travis. I'll see if I can make it possible to over-ride the default user by specifying the target GitHub account as an argument.

At the moment I'm thinking this will be a generic utility script to call instead of running the code from the readme / guides. Then we can call it with specific arguments in Travis, either as a separate script or in the build part of the yaml configurations.

@TomKellyGenetics TomKellyGenetics removed the work-in-progress Proposal for a feature in development, don't merge label Sep 12, 2020
@TomKellyGenetics
Copy link
Member Author

This is stable in my opinion (except for updating English source lessons). As tested for PR #114.

Lessons updated: https://swcarpentry-ja.github.io/r-novice-gapminder/ja/index/

@joelnitta or @rikutakei should be able to do this by running this in future.

sh wrapper.sh --repo r-novice-gapminder --account swcarpentry-ja --webpages

@TomKellyGenetics TomKellyGenetics added the technical For improvements to scripts and issues with webpages label Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request technical For improvements to scripts and issues with webpages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants