This document is under heavy development as we're currently working on open-learning
tutorand that has impact on what you see here
This document outlines how to publish git4ol lesson activity blocks.
Make sure to git fetch refs first:
note
In this example we're going to publish
activityblocks from the lessonmarkdown@0.0.0from the remoteorigin
user@shell:~/git4ol$ git fetch origin refs/markdown@0.0.0/*:refs/markdown@0.0.0/*Generate git subtrees from refs:
note
In this example we're using the current repository
./to reuse our currentorigin.
user@shell:~/git4ol$ for ref in $(git for-each-ref --format="%(refname)" refs/markdown@0.0.1); do git subtree add --message "published $ref" --message "published $ref" --prefix=$ref $ref; doneGenerate .md file with the commit message from refs:
user@shell:~/git4ol$ for ref in $(git for-each-ref --format="%(refname)" refs/markdown@0.0.0); do git log -1 --format="---%nid: %H%n%ntitle: %s%nnotes:%N%n%b" $ref -- > $ref.md; doneUsing markdown-to-json you can now generate activities.json:
note
You have to
npm installyourself, make sure to get a version that supports the--contentparameter
user@shell:~/git4ol$ m2j --width 0 --content refs/markdown\@0.0.0/*/*.md > refs/markdown\@0.0.0/activities.jsonIf you intend to host your lesson using GitHub pages you should turn off Jekyll by adding a .nojekyll file to the root of your gh-pages branch.
note
If you need Jekyll for this site there may be ways to optionally turn this of per path, but I don't know how. Please PR if you do.
Now all that is left is to git add and git commit our changes before finally doing a git push - but you can do that on your own.