1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-15 14:27:50 +02:00
comprehensive-rust/mdbook-course
Dustin J. Mitchell a73c830e45
Add course and session markers for deep-dives (#1521)
This doesn't add any timing information. The authors of each deep-dive
can do that separately.

Fixes #1510.
2023-11-30 09:26:21 -05:00
..
src Add course and session markers for deep-dives (#1521) 2023-11-30 09:26:21 -05:00
Cargo.toml Comprehensive Rust v2 (#1073) 2023-11-29 16:39:24 +01:00
README.md Comprehensive Rust v2 (#1073) 2023-11-29 16:39:24 +01:00

mdbook-course

This is an mdBook preprocessor to handle some specific details of Comprehensive Rust.

Frontmatter

The preprocessor parses "frontmatter" -- YAML between --- at the beginning of a Markdown file -- and removes it from the rendered result.

Frontmatter is optional, and can contain any of the following fields, defined below:

minutes: NNN
course: COURSE NAME
session: SESSION NAME

Course Structure

A book can contain multiple courses. Each course is made up of sessions, which are blocks of instructional time (and include breaks). Typically two sessions are taught per day, morning and afternoon.

Each session is comprised of segments, which are slides on a related theme. Breaks are scheduled between segments.

Each segment is comprised of slides. A slide can be made up of one or more mdBook chapters.

The course structure is derived from the mdBook structure. Each top-level mdBook "section" is treated as a segment, and may optionally begin a new session or course. Within each section, the first chapter and subsequent second-level chapters are each treated as a slide. Any further-nested chapters are treated as parts of the parent slide. For example:

- [Frobnication](frobnication.md)
  - [Integer Frobnication](frobnication/integers.md)
  - [Frob Expansion](frobnication/expansion.md)
    - [Structs](frobnication/expansion-structs.md)
    - [Enums](frobnication/expansion-structs.md)
  - [Exercise](frobnication/exercise.md)
    - [Solution](frobnication/Solution.md)

In this segment, there are four slides: "Frobnication", "Integer Frobnication", "Frob Expansion", and "Exercise". The last two slides are made up of multiple chapters.

The first chapter of a segment can use the course and session fields in its frontmatter to indicate that it is the first segment in a session or course.

Timing

Each chapter should specify an estimate of the instructional time it will require in the minutes field. This information is summed, with breaks automatically added between segments, to give time estimates for segments, sessions, and courses.

Directives

Within the course material, the following directives can be used:

{{%segment outline}}
{{%session outline}}
{{%course outline}}
{{%course outline COURSENAME}}

These will be replaced with a markdown outline of the current segment, session, or course. The last directive can refer to another course by name and is used in the "Running the Course" section.