lessons

package
v0.1.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package lessons reads the runnable blocks out of the course pages: the fenced code blocks under website/src/content/docs/learn (and the migration guides) that an `<!-- learn -->` comment marks as something a reader types. scripts/learncheck runs them so a lesson cannot rot, and scripts/tapes runs the ones a tape expects to have happened before it starts recording.

Index

Constants

View Source
const Dir = "website/src/content/docs/learn"

Dir is where the course pages live, relative to the repository root.

Variables

This section is empty.

Functions

func Page

func Page(root, lesson string) (string, error)

Page finds the one lesson page with that number prefix, "02".

Types

type Block

type Block struct {
	File string
	Line int // line of the opening fence, 1-based
	Code string
}

Block is one runnable fence: where it came from and what it holds.

func Blocks

func Blocks(root, lesson string) ([]Block, error)

Blocks returns the runnable blocks of the lesson with that number prefix, in page order.

func Extract

func Extract(file string, content string) []Block

Extract returns the runnable blocks of one Markdown page in order.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL