Skip to content

Lesson files

Every field of a course and a lesson, the level blocks and the slots filled from the learner's project.

Applies to EngineCloud
View as Markdown
On this page
  1. A course: learn/<course>/course.yaml
  2. A lesson: learn/<course>/<lesson>.lesson.md
  3. The header
  4. Selectors in uses
  5. The body
  6. Rules

A course: learn/<course>/course.yaml

learn/use-cases-first/course.yaml
format: 1
id: use-cases-first
title: Your app as use cases
description: Describe what people can do in your app, and what can go wrong.
level: [starter, builder]
language: es
languages: [es, en]
lessons: [what-is-a-use-case, failures-have-names, journeys, the-map-is-the-scope]
checkpoints: [the-map-is-the-scope]
FieldTypeWhat it is
format1the format version; tools refuse one they do not know
id, title, descriptiontextthe course; id matches ^[a-z][a-z0-9-]{1,62}$
levellistthe levels it is written for
language, languagescodesthe language it was made in first, and every language it has
lessonslistlesson ids, in order
checkpointslistlessons that, once passed, let Learn propose the next level

A lesson: learn/<course>/<lesson>.lesson.md

learn/use-cases-first/failures-have-names.lesson.md
---
id: failures-have-names
title: Failures have names
goal: You can name what can go wrong in a case, and what the person is told.
level: [starter, builder]
step: map
needs: [what-is-a-use-case]
minutes: 8
video:
  file: media/failures-have-names.mp4
  captions: { es: media/failures-have-names.es.vtt, en: media/failures-have-names.en.vtt }
  chapters: [{ at: 0, title: A case that can fail }, { at: 95, title: What the customer reads }]
uses:
  case: { has: failures }
exercise:
  brief: Add a case where a customer cancels an order, with the failure that says it is too late.
  checks:
    - cases-check
    - case: { exists: true, has: failures }
    - question: why-name-it
---

Your case «{{case.title}}» can end badly: {{case.failures[0].name}}.

:::level starter
Think of what your customer reads when that happens. That sentence is part of your app.
:::

:::level builder
The failure's `name` is what the code and the traces use; its `tell` is what the person reads.
:::

:::question why-name-it
Why give a failure a name instead of showing «Error»?
- [x] So the person knows what happened and what to do
- [ ] So the app looks more technical
:::

The header

FieldRequiredWhat it is
id, titleyesa stable id and the title people see
goalyesone sentence: what you can do after the lesson
levelyesthe levels it is written for
stepyeswhere it sits in the Sypnia way: idea, map, contract, design, data, code, publish or production
needsnolessons it expects you to have done; shown, never enforced
minutesnoabout how long it takes
videonothe file, its captions per language and its chapters
usesnowhat to take from the learner’s project, by slot (Lessons on your project)
exercisenothe brief, the branch (default learn/<id>) and the checks (Checks)

Selectors in uses

SlotSelectorPicks
casehas: failures, has: where, writes: 2a case with failures, with a place in the app, or writing at least two tables
tablerls: truea table with row-level security
traceerror: truea trace that ended in a failure (preview or test by default)
promisetruea promise of the landing page with its cases

With no match, the slot is filled from the sample project, La Espiga.

The body

  • Markdown, with the slots {{case.title}}, {{case.id}}, {{case.failures[0].name}}, {{table.name}}, {{trace.case}} filled from the chosen items.
  • Level blocks :::level starter builder … ::: appear only for those levels. Text outside them is for everyone.
  • Questions :::question <id> … ::: with options; [x] marks the right ones. A question can be a check.

Rules

  • One file per language: failures-have-names.lesson.md is the course’s first language, failures-have-names.en.lesson.md another one. Same header fields; only text changes.
  • Unknown fields are kept and reported as warnings. Your own fields start with x-.
  • npx @sypnia/learn lint <folder> checks everything above.
  1. A course: learn/<course>/course.yaml
  2. A lesson: learn/<course>/<lesson>.lesson.md
  3. The header
  4. Selectors in uses
  5. The body
  6. Rules

    Search pages, sections and terms