@@ -34,7 +34,7 @@ inductive ExampleCodeStyle where
3434 The example code should be extracted to a Lean project from the tutorial.
3535 -/
3636 | inlineLean (moduleName : Lean.Name) (toolchain := defaultToolchain) (liveProject := some defaultLive)
37- deriving BEq, DecidableEq, Inhabited, Repr, ToJson, FromJson
37+ deriving BEq, Hashable, DecidableEq, Inhabited, Repr, ToJson, FromJson
3838
3939open Manual (Tag InternalId) in
4040/-- Metadata on tutorials. -/
@@ -46,10 +46,10 @@ structure Tutorial.PartMetadata where
4646 /-- The internal unique ID, which is automatically assigned during traversal. -/
4747 id : Option InternalId := none
4848 /-- A summary to show on the overview page. -/
49- summary : String
49+ summary : Verso.Doc.Inline Manual
5050 /-- How should the code samples in this tutorial be extracted to a downloadable tarball? -/
5151 exampleStyle : ExampleCodeStyle
52- deriving BEq, DecidableEq , Inhabited, Repr, ToJson, FromJson
52+ deriving BEq, Hashable , Inhabited, Repr, ToJson, FromJson
5353
5454/--
5555Information that tracks the current context of traversal for a set of tutorials.
@@ -100,7 +100,7 @@ open Manual (ExtensionImpls)
100100
101101/-- The metadata to use for a tutorial when the user does not specify any. -/
102102def defaultMetadata (p : Part Tutorial) : Tutorial.PartMetadata :=
103- { slug := p.titleString.sluggify.toString, summary := "" , exampleStyle := .inlineLean `Main }
103+ { slug := p.titleString.sluggify.toString, summary := inline s! "" , exampleStyle := .inlineLean `Main }
104104
105105instance : TraversePart Tutorial where
106106 inPart p ctx :=
@@ -186,6 +186,9 @@ instance : Traverse Tutorial TraverseM where
186186 -- Next, assign a tag, prioritizing user-chosen external IDs
187187 «meta » := { «meta » with tag := ← withReader (TraversePart.inPart part) <| tagPart part «meta » (·.id) (·.tag) savePartXref }
188188
189+ -- Traverse the metadata's description
190+ «meta » := { «meta » with summary := ← withReader (TraversePart.inPart part) <| Genre.traverseInline Manual «meta ».summary }
191+
189192 pure <|
190193 if «meta » == startMeta then none
191194 else pure { part with metadata := some «meta » }
0 commit comments