This project builds codeclub exercises from markdown to styled webpages. A file watcher builds upon changes and refreshes the browser. Watching is done through gulp and build are done with metalsmith.
Here is a screenshot with exmaple of workflow:
You will need node and git for using this software.
codeclub_lesson_builder should be cloned into a lesson project where markdown
lessons are in a src
folder. This simplifies setup for contributors, as
codeclub_lesson_builder can be included as a git submodule and cloned
recursively. Cloning lesson repo for contributors (instead of this repo with
lessons as submodule) will make pull request to the lesson repo a bit less
complex. The steps below assumes this setup, and are only needed upon first
time inclusion in the lesson repo. Steps for setting up lesson repo with
local building should be similar to this. Look at
this repo for an example of setup
and http://kodeklubben.github.io for the live Norwegian lesson pages made
with this build tool.
Clone repository
git clone https://github.com/arve0/codeclub_lesson_builder
Installing requirements
cd codeclub_lesson_builder
npm install
cp utils/gulp utils/gulp.bat ..
cd ..
*Run server nix
./gulp
Run server windows
gulp.bat
nodejs is not installed as node, and this causes problems for some packages. To fix this, link node to nodejs like so BEFORE installing packages through npm:
sudo ln -s /usr/bin/nodejs /usr/local/bin/node
Gulp and metalsmith read files in parallel, which might cause trouble for some users. If number of open files exceeds operating system limits, one will get an EMFILE error code. Description for increasing number of allowed open files:
![Gitter](https://badges.gitter.im/Join Chat.svg)
Having problems? Come and chat with us on gitter.
You could read about the format in FORMAT.md.
- Convert markdown to styled HTML
- Convert markdown to styled PDF (fast! 100 PDFs in ~30 seconds)
- Link-checker
- Automatic build with github webhooks
- Zip-archive of collections/courses
- Styled scratch code blocks
- Adjust the templates to your own liking
- Watch files and re-render lesson upon changes (live-reload in browser)
- Create playlists and hide lessons from index
- Use material from other webpages with
external
-tag - Add notes to footer with
footer
-tag - Lesson tags
- Sortable index with search
- Support for several languages
You can run tasks with ./gulp taskname
when in the lesson repo, or with gulp taskname
in
codeclub_lesson_builder-folder if you have installed gulp globally.
list of gulp tasks
archive
will create zip files of collectionsassets
copies assets tobuild/assets
build
builds all markdown files (except README.md) to html and copy files which are in lesson-foldersclean
delete all files inbuild
css
will process less files, add asset-css, autoprefix, minify and concat tostyle.min.css
js
uglify, add already uglified asset-js and concat toscript.min.js
pdf
will create PDFs of all htmls in build folderserver
will start a local web-server and open your browser with the indexdefault
start theserver
-task and reload browser upon file changes (runs when gulp recieves no arguments)dist
does a clean then a complete buildlinks
runs a local server and check all links on all pagesprodlinks
check links on production page, setproductionCrawlStart
in config.jsgithub
start webhook server which listens for pushes to repo and starts build