-
Notifications
You must be signed in to change notification settings - Fork 14
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
Test script to render files as webpages #82
Test script to render files as webpages #82
Conversation
@@ -0,0 +1,100 @@ | |||
remote_theme: "carpentries-i18n/carp-theme" |
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.
This file is to reset the config for a multilingual English lesson. I've done this manually for the R-gapminder lessons but haven't scripted this yet. Ended up down a rabbit hole with submodules...
echo "update local submodules" | ||
#git submodule update --recursive --merge | ||
|
||
#remove _locale directory (only translate English lessons) |
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.
Don't worry about what this is doing too much. The issue really is that we can't pull updates for submodules from the right branch as David uses the "master" branch renamed as "gh-pages" so the history doesn't match when you pull "origin".
Merging updates might be tricky because of this but I should be able to sort it out.
git add -u | ||
git commit -m "reset branch" | ||
git checkout HEAD | ||
rm -rf _locale |
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.
The main thing is we want a git repo of the "gh-pages" branch with the _locale
directory deleted but not commited (so that we can restore it below)
if [ -d $dir ] | ||
then | ||
cd $dir | ||
git reset --hard |
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.
This will restore the repo to the git HEAD
commit (this undeletes the _locale
directory).
git pull swc-ja master | ||
|
||
# remove files provided by template | ||
rm -rf bin/boilerplate |
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.
These need to be deleted for the template to work from carpentries-i18n/carp-theme
fi | ||
|
||
#push updated locale lessons to English lesson | ||
git add -u |
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.
This commits updates to the submodules (adding new lessons in repo/_locale/ja
)
This is stable in my opinion (except for updating English source lessons). As tested for PR #114.
|
🚨work-in-progress 🚨
Script to render webpages and handle submodules for merge PO files (see #81)
Additions
synchronises existing English lessons to the archived versions as submodules of
i18n
temporarily removes
locale
files for all lessons so only English (source) -> Japanese (target language) PO files are generated, restores these from git history afterpo4gitbook
scripts are run so these are not changed unless--update
is calledcreates branches and submodules as needed and updates or resets pre-existing ones
This allows the English lessons to be handled entirely as submodules rather than creating and updating external repos
To do (mostly notes to future me):
migrate translated repos (e.g., r-novice-gapminder-ja) to submodules of i18n rather than external repos, this will mean local changes can be done entirely within the
i18n
repo (we may need to organise this more and make surepo4gitbook
only runs on English lessons)scripts to pull updates from new English lessons, this can merge updated sections into the PO files but could be tricky since David uses
master
notgh-pages
branches (let's leave this for another day)now that I've figured out how to convert and English lesson to the multilingual format (menus with the 🌐icon), we could script this rather than forking
carpentries-i18n
/carpentries-ES
versions (they seem to be inactive now they're using transifex), not sure how often we'll need it though so I'm okay to do it manually as requiredfigure out how to call it on travis CI to build new lessons when merged, this will be a lot easier if everything is contained as a submodule I think
🚨work-in-progress 🚨
this script has not been tested thoroughly
Please do not use it to push to the
swcarpentry-ja
organisation repos, we should test it on forks on a user account first.