Write a course in OpenQuarry
Write a course, a unit and a lesson as three plain files, then check them with the OpenQuarry validator.
A course is a folder of plain files
OpenQuarry keeps a course as plain files. A fabric holds your collection. A weave is a course, a loom is a unit, and a thread is a lesson: one Markdown file with YAML frontmatter.
Set kind: course on the weave and kind: unit on the loom. A lesson uses contentType: lesson. The optional teaches and requires lists name skill ids.
A minimal course in three files
Create these three files, then replace the names and the lesson text with your own. State the licence you choose for your content: the schema’s default is MIT, and a tool that fills in defaults writes MIT where the key is missing.
weaves/first-course/weave.yaml
slug: first-course
title: My first course
kind: course
license: All rights reserved
weaves/first-course/first-unit/loom.yaml
slug: first-unit
title: My first unit
kind: unit
weaves/first-course/first-unit/first-lesson.md
---
id: 3fce914f-0801-45fd-b886-f0521aeeb4a1
slug: first-lesson
title: My first lesson
version: 1.0.0
contentType: lesson
publishing:
status: draft
license: All rights reserved
---
# My first lesson
Explain one idea in plain words.
Give a worked example and a question to try.
Use a fresh UUID for each new thread. An optional fabric.yaml can declare format: openquarry and version: 2. Add a catalogue when you need to group several courses.
Check the files with the validator
Install the package in your authoring project:
npm install @framers/openquarry yaml
Parse the YAML frontmatter, then pass the result to the validator:
import { parse } from 'yaml';
import { validateThreadFrontmatter } from '@framers/openquarry';
const result = validateThreadFrontmatter(parse(frontmatterText));
if (!result.valid) console.log(result.errors);
frontmatterText is the YAML between the opening and closing lines of three hyphens. Use validateWeave for weave.yaml and validateLoom for loom.yaml. Each returns valid and errors.
Read the lesson yourself before you publish
The validator checks the shape of a file and the values each key may take. Whether an explanation is true, whether a question is good and whether you hold the rights to what you include are yours to check. Quarry School adds its own lesson renderer and content checks on top of the format.
Source and full examples: the @framers/openquarry README, the Reading a map example course and openquarry.dev.
Updated