OpenQuarryGitHub

The OpenQuarry format: Markdown files, folders and manifests

Each note or lesson is one Markdown file with YAML frontmatter. Folders group the files into looms, looms into weaves and weaves into a fabric.

Fabric / Field skills

Weave / Reading a map

Loom / The map

Thread / Scale and distance

Four levels of files and folders

A thread is one note or lesson, a Markdown file with YAML frontmatter. A loom is a folder of threads, and looms can nest. A weave groups looms into one knowledge base or one course. A fabric is the folder that holds the weaves.

The example course on disk

Files
reading-a-map/                 fabric
├── fabric.yaml
├── catalogue.yaml             optional course catalogue
└── weaves/
    └── reading-a-map/          weave
        ├── weave.yaml
        └── the-map/            loom
            ├── loom.yaml
            └── scale-and-distance.md  thread

For a new project, add a fabric.yaml with format: openquarry and version: 2. Without one, the layout reads as version 1. weave.yaml needs a slug and a title, and kind: course marks the weave as a course. loom.yaml is optional for an ordinary folder, and kind: unit in it marks a unit of a course.

A lesson from the example course

Every thread needs five keys: id, slug, title, version and contentType. The lesson's Markdown follows the frontmatter.

scale-and-distance.md
---
id: 70c967bf-2dba-4399-aef1-671174eb904f
slug: scale-and-distance
title: Scale and distance
summary: The scale says how much smaller the map is than the ground. With it, a length on the map becomes a distance you can walk.
version: 1.0.0
contentType: lesson
difficulty: beginner
taxonomy:
  subjects: [navigation]
  topics: [maps]
relationships:
  - target: what-a-map-shows
    type: follows
teaches:
  - field-skills/skill/map-scale
requires:
  - field-skills/skill/map-symbols
publishing:
  status: published
  license: MIT
---

# Scale and distance

The scale says how much smaller the map is than the ground. A scale of 1:25,000 means that one unit on the map is 25,000 of the same unit on the ground.

## From the map to the ground

At 1:25,000, 1 cm on the map is 25,000 cm on the ground. That is 250 m. So 4 cm on the map is 1 km.

At 1:50,000, 1 cm on the map is 500 m on the ground, and 2 cm is 1 km.

## Example

A path measures 6 cm on a 1:25,000 map.

6 cm x 250 m = 1,500 m

The path is 1.5 km long.

## A common mistake

A bigger second number means a smaller drawing. A 1:50,000 map shows the same path at half the length a 1:25,000 map gives it.

Follow every file of the example course, or read the thread schema.

Version 1 fabrics and the old name, strand

A thread is one Markdown note or lesson. Older OpenQuarry files called the same thing a strand.

Writing and reading threads

New work uses thread.schema.yaml, threadSchema and ThreadFrontmatter. The deprecated strandSchema and StrandFrontmatter exports keep working, and the deprecated strand.schema JSON Schema and its YAML source stay at their published addresses.

A fabric without fabric.yaml reads as version 1. Readers of both versions accept the looms/ and strands/ prefix folders. openquarry check and the starter checks print a warning for a valid thread under either one.

Text
ok weaves/reading-a-map/looms/the-map/strands/scale-and-distance.md
  warning: Version 1 folder names in a version 2 fabric. Move the thread to weaves/<weave>/<loom>/<thread>.md.

A new fabric sets format: openquarry and version: 2 in fabric.yaml and keeps each thread at a path such as weaves/reading-a-map/the-map/scale-and-distance.md. To move an older layout, move the files and update the paths that point at them in the same change. Keep each thread's id, and check its links after the move.

Fields and stored values

FabricNodeType uses 'thread' for new nodes. The deprecated KnowledgeNodeType keeps its original values, the stored value 'strand' among them.

Current blocks-index field Deprecated alias Where it appears
threads strands Top-level index
threadPath strandPath Tag references
stats.totalThreads stats.totalStrands Index statistics

A blocks index needs each renamed field under one of its two names. When it has both, both must pass the schema and the value under the thread name wins. A fabric manifest keeps every field its publisher writes.

validateBlocksIndex returns { valid, errors }. With { normalize: true } as the second argument, a valid index comes back as value under the thread names, with a warning when it used a strand name. The input object is left as it was. openquarry check and the starter checks print one deprecation line for each valid index that uses a strand name, with the names that replace them.

When the aliases retire

The published schema addresses stay. The format accepts the strand fields, stored values, exports and folder names until a breaking release that documents the migration, and no date is set for one.

A proposed field for two reading depths

The format has no field that marks two depths of the same text. A thread can carry extractiveSummary or aiSummary, and a summarizes link can join a short thread to a longer one.

Read the proposal for core, detail and refresher blocks

This is a proposal. The 0.3 schemas have no field for two depths of the same text, and the proposal changes no schema.

Fields that describe a thread's level and summary

A thread can carry two summaries. extractiveSummary comes from a summary pipeline and aiSummary from a model, and summary is a deprecated alias. Each block has its own extractiveSummary. difficulty gives the thread's level. Typed links such as summarizes, extends and refines join separate threads, and teaches and requires name skills. These fields help a reader pick threads. None of them marks a passage inside a thread to hide.

Proposed fields

The proposal adds an optional overview string to the thread, written by the author to introduce the whole thread, and an optional depth on each block with three values.

  • core marks the essential explanation, shown first.
  • detail marks a derivation, a worked example or further explanation, opened on request.
  • refresher marks a reminder of a prerequisite, opened when a learner needs it.

An app could show the overview and the core blocks first, with a Full explanation control that opens every block in source order. A learner new to the subject could open the full explanation from the start. The author sets depth, and it is separate from difficulty.

Depths marked in the Scale and distance lesson

The fragment below marks three passages of the Scale and distance lesson with the proposed keys. Its line numbers count from the first line of the file, frontmatter included, and a publisher updates them whenever the lesson changes. The excerpt shows the proposed overview and depth keys beside the existing block ids, types and lines.

YAML
overview: Turn a distance on the map into a distance on the ground.
blocks:
  - id: scale-rule
    line: 26
    endLine: 26
    type: paragraph
    depth: core
  - id: conversion
    line: 30
    endLine: 32
    type: paragraph
    depth: detail
  - id: scale-reminder
    line: 44
    endLine: 44
    type: paragraph
    depth: refresher

The core block says what 1:25,000 means. The detail block works through centimeters and meters. The refresher reminds the learner that a bigger second number means a smaller drawing.

Rules for older content, and questions to settle first

A block without depth counts as core, so older content stays fully visible. An app that does not read depth shows the full Markdown. A warning or a premise the lesson depends on never sits only in a detail block. Headings stay with their content, and every block keeps its place in the document order and stays reachable by keyboard, search and print.

The thread schema accepts keys it does not name on a thread and its blocks. An otherwise valid thread may carry depth, and that does not make depth part of the format. Settle four questions first:

  • how a block keeps its identity and its line range;
  • whether overview is plain text;
  • how overlapping ranges behave;
  • how an author's marks survive reindexing.

The change starts in the source schemas in framerslab/codex and is synced into this repository. The types and tests follow, and apps add support last. Neither the example course nor the schemas use any of these fields.