UNCLASSIFIED

Skip to content
Snippets Groups Projects
user avatar
Ben authored
62eda714

Courseware Builder

Purpose

This tool takes a code-driven courseware and outputs a static website for instructors, students, and training developers. The format uses Terminal Learning Objectives and Learning Steps, consistent with TRADOC lesson plans, to output lesson content in a format that is written once and exported for various audiences.

You can preview the output of this builder here:

How it works

The tool converts the lesson plan directory structure into a dictionary. This dictionary is then fed into various mako templates to output lesson-plan specific markup (asciidoctor, markdown). This includes instructor and student books, slides, and a full TRADOC-style lesson plan. The content and slides are available in HTML form and in PDF output. This is output is layered on top of a hugo static website, which then produces an instructor and student view of the content.

All of the tooling is contained in a docker container, available at https://git.cybbh.space/courseware-as-code/courseware-builder/container

The theme for the hugo website is a fork of hugo-book, available at https://git.cybbh.space/courseware-as-code/courseware-builder/hugo-book

Further Reading

You can read documentation for the Training Development format and the tool itself in a course built using the standardized format, available here:

Courseware as Code Book:

https://courseware-as-code.cybbh.io/courseware-builder/course/instructor/

Course Builder Lesson:

https://courseware-as-code.cybbh.io/courseware-builder/course/instructor/course/2_lessons_plans_as_code/0_course_builder/student_book/

Dependencies:

  • docker

Usage

To build the example course, run ./build.sh

You can then preview the website with:

cd output
python -m "SimpleHTTPServer"
#access your server on the port :8000

Generating pdfs of slides requires manually launching chromium to render and generate the slides. For testing, you can skip this step with:

DEBUG_ONLY=1 bash build.sh

A breakdown of the output:

Student Content

  • ${OUTPUT_DIR}/${PROJECT}_student - Student version content prior to export
  • ${OUTPUT_DIR}/${PROJECT}_student_output/ - Student version hugo content prior to build
  • ${OUTPUT_DIR}/${PROJECT}_student_output/public/ - Student version static website as generated by hugo

Instructor Content

  • ${OUTPUT_DIR}/${PROJECT}_instructor - Instructor version content prior to export
  • ${OUTPUT_DIR}/${PROJECT}_instructor_output/ - Instructor version hugo content prior to build
  • ${OUTPUT_DIR}/${PROJECT}_instructor_output/public/ -Instructor version static website as generated by hugo

Environmental Variables

The following environmental variables are available in the build script:

  • OUTPUT_DIR - defines the directory to store output of material; default: output
  • PROJECT - defines the directory of the course containing the course material. This is copied, but the original is never modified. default: example_course
  • CONTAINER - defines the container used to build the courseware. Don't change this unless you're forking the container for your own needs. default: registry.cybbh.space/courseware-as-code/courseware-builder/container:latest
  • INSTRUCTOR_BASE_URL - defines the path to the root of the file structure for the instructor website when building URLs in hugo. default: /${PROJECT}_instructor_output/public/
  • INSTRUCTOR_BASE_HOST - defines the hostname part of the URI, ie: "https://example.com" - default is blank.
  • STUDENT_BASE_URL - defines the path to the root of the file structure for the student website when building URLs in hugo. default: /${PROJECT}_student_output/public/
  • STUDENT_BASE_HOST - defines the hostname part of the URI, ie: "https://example.com" - default is blank.
  • BUILD_STUDENT - when set to "True" will build the student website. This provides flexibility to split student and instructor pipelines into separate jobs. default: True
  • BUILD_INSTRUCTOR - when set to "True" will build the instructor website. This provides flexibility to split student and instructor pipelines into separate jobs. default: True
  • CI_MODE - when this variable is set, docker is run without a tty and without interactive mode (-ti flags). This is useful in CI pipelines but removes ability to interact with docker container when testing (such as to cancel a build with ^C)
  • VERBOSITY - logging level noise. values supported: 2 - verbose, 1 - normal, 0 - low, -1 - none. Default: 1