Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var DefaultConfig = codeblock.Config{ EnablePHP: true, EnableVuego: true, EnableSQLite: true, }
DefaultConfig enables the evaluators the tour relies on. Shell execution is intentionally left disabled.
Functions ¶
func ValidateLesson ¶
ValidateLesson checks that a lesson has at least one runnable file.
func ValidateTour ¶
ValidateTour checks that all lessons in the tour have valid content.
Types ¶
type Chapter ¶
type Chapter struct {
Name string // Chapter name (from filename)
Title string // Chapter title (from # heading or filename)
Lessons []*Lesson // Lessons in this chapter
Index int // Chapter index (0-based)
}
Chapter represents a chapter containing multiple lessons.
type Lesson ¶
type Lesson struct {
ID string // Unique identifier (chapter/lesson index)
Title string // Lesson title from ## heading
Content string // Markdown content for the lesson
Files map[string]string // Template and data files for this lesson
FileRefs []string // File paths from @file: references
FileOptions map[string][]string // Optional hints from @file references, keyed by filename
Chapter string // Parent chapter name
ChapterTitle string // Parent chapter title (friendly name)
ChapterSlug string // URL-friendly chapter name (e.g., "interpolation")
ChapterIdx int // Chapter index (0-based)
LessonIdx int // Lesson index within chapter (0-based)
HasPrev bool // Whether there's a previous lesson
HasNext bool // Whether there's a next lesson
PrevID string // Previous lesson ID
NextID string // Next lesson ID
PrevSlug string // Previous lesson chapter slug
PrevLessonIdx int // Previous lesson index
NextSlug string // Next lesson chapter slug
NextLessonIdx int // Next lesson index
TotalInChapter int // Total lessons in this chapter
}
Lesson represents a single lesson within a chapter.
func (*Lesson) DataFile ¶
DataFile returns the data filename (.yaml or .json) that matches the primary template.
func (*Lesson) PrimaryTemplate ¶
PrimaryTemplate returns the main .vuego template filename for the lesson. It looks for index.vuego first, then any .vuego file.
type Module ¶
type Module struct {
platform.UnimplementedModule
FS fs.FS
// contains filtered or unexported fields
}
Module represents the tour module for the platform.
type Tour ¶
type Tour struct {
Chapters []*Chapter
// contains filtered or unexported fields
}
Tour holds all chapters and lessons.
func ParseTour ¶
ParseTour parses a tour from the given filesystem. It expects markdown files in the root and lesson files in subdirectories.
func (*Tour) FirstLesson ¶
FirstLesson returns the first lesson in the tour.
func (*Tour) GetLessonByName ¶
GetLessonByName returns a lesson by chapter name and lesson index. The chapter name is matched against the suffix of the chapter name (e.g., "interpolation" matches "01-interpolation").
func (*Tour) LessonCount ¶
LessonCount returns the total number of lessons.