Skip to main content

Authoring

Lernkit lessons are MDX files. You write Markdown for the prose, drop in React-island widgets for anything interactive, and Astro / Starlight handles the build. This section is the practical reference for everything an author needs to know.

What's in this section​

PageWhen to read
Course structureSetting up a new course; understanding the file layout
Writing lessons in MDXDaily authoring β€” frontmatter, imports, mixing prose + components
Quizzes<Quiz>, <MCQ>, <TrueFalse> β€” props, examples, grading model
Runnable Python cells<RunnablePython> β€” Pyodide-backed in-browser Python
Runnable Robot Framework cells<RunnableRobot> β€” full RF execution in-browser
Code blocks and syntax highlightingExpressive Code, syntax-highlighted languages, frames, line markers
Tables, callouts, imagesStarlight components for non-interactive content
Cross-lesson navigationSidebar config, prev/next, deep links, the SPA router

A minimal authoring loop​

pnpm --filter=@lernkit/docs dev
# β†’ http://localhost:4321/rf-training/

Edit any .mdx file under apps/docs/src/content/docs/. Astro hot-reloads. Once you're happy:

pnpm --filter=@lernkit/docs build
COURSE_ROOT_DIR=rf-training INCLUDE_PYODIDE_RUNTIME=1 \
node apps/docs/scripts/package-scorm12.mjs
# β†’ apps/docs/dist-packages/scorm12/<course>-<version>-scorm12.zip

Drop the zip into your LMS.

Mental model​

Author writes: Lernkit produces:
───────────── ────────────────
src/content/docs/ dist/
rf-training/ rf-training/
section-1/ ─── astro ──→ section-1/
1-1-install.mdx build 1-1-install/
# Heading index.html
Prose… [+ assets in _astro/]
<RunnableRobot/> ↓
packageScorm12()
↓
dist-packages/scorm12/
<course>-<v>-scorm12.zip

Author surface: just the .mdx files. The Astro / packager / runtime layers don't intrude on the content tree.

Common authoring needs (decision tree)​

  • Adding a section header β†’ use ## Heading (Markdown).
  • Adding emphasis or links β†’ use Markdown (**bold**, [text](url)).
  • Embedding a code sample (read-only) β†’ use a fenced code block. See Code blocks.
  • Embedding code the learner can edit and run (Python) β†’ use <RunnablePython>.
  • Embedding code the learner can edit and run (Robot Framework) β†’ use <RunnableRobot>.
  • Asking a knowledge-check question β†’ use <MCQ> or <TrueFalse>.
  • Bundling a few questions into a graded review β†’ use <Quiz>.
  • Adding a tip / warning / note callout β†’ use Starlight's <Aside>. See Tables, callouts, images.
  • Adding tabs (e.g., per-OS instructions) β†’ use Starlight's <Tabs> / <TabItem>. See Tables, callouts, images.
  • Linking to another lesson β†’ use a relative Markdown link. See Cross-lesson navigation.

Where to start​

If you've never authored a Lernkit lesson before, read in this order:

  1. Course structure to understand where files go.
  2. Writing lessons in MDX to write your first lesson.
  3. Quizzes to add a knowledge check.
  4. Cross-lesson navigation to wire your lesson into the sidebar.

The other pages are reference; come back to them as needed.