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.
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.
git clone https://github.com/arve0/codeclub_lesson_builder
cd codeclub_lesson_builder npm install cp utils/gulp utils/gulp.bat .. cd ..
*Run server nix
Run server windows
Note Ubuntu users!
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
Note - Maximum number of open files
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:
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)
- Automatic build with github webhooks
- Styled scratch code blocks
- Adjust the layouts 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
- Add notes to footer with
- Lesson tags (searchable, but not displayed)
- Sortable index with search
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
assetscopies assets to
buildbuilds all markdown files (except README.md) to html and copy files which are in lesson-folders
build-indexesbuilds front-page and lesson indexes
searchIndex.jsonwhich is used for client-side search with lunr
cleandelete all files in
csswill process less files, add asset-css, autoprefix, minify and concat to
js:clientbrowserify client scripts, entry point is [
js:client, but also uglify and create source maps
js:vendorconcat vendor scripts
serverwill start a local web-server and open your browser with the index
server-task and reload browser upon file changes (runs when gulp recieves no arguments)
distdoes a clean then a complete build
linksruns a local server and check all links on all pages
prodlinkscheck links on production page, set
githubstart webhook server which listens for pushes to repo and starts build