Skip to content

Commit 142f6c8

Browse files
feat: tutorials genre (#600)
Adds a genre for tutorials. Tutorials are very much like the manual genre, and re-use most of its infrastructure and extensions. The differences are: 1. The rendering of tutorials is more flexible, designed to fit in to existing web designs (and in particular, the Lean design). 2. Tutorials have different metadata, and will not initially support non-HTML output. Additionally, tutorials will feature support for loading their content on live.lean-lang.org and downloading their example code.
1 parent 4abb984 commit 142f6c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+4239
-305
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,6 @@ _out
99
/.verso/
1010
/src/tests/integration/**/output
1111
/node_modules
12+
*.hash
13+
profile.json
14+
profile.json.gz
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
/-
2+
Copyright (c) 2025 Lean FRO LLC. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Author: David Thrane Christiansen
5+
-/
6+
import VersoTutorial
7+
import TutorialExample
8+
9+
open Verso.Genre Tutorial
10+
11+
open Verso.Doc.Concrete in
12+
def content : Tutorials where
13+
content :=
14+
(verso (Blog.Page) "Example Tutorial Site"
15+
::::
16+
Here are some examples of the tutorials feature.
17+
::::).toPart
18+
19+
topics := #[
20+
{ title := #[inlines!"Data"],
21+
titleString := "Data",
22+
description := #[blocks!"These tutorials describe the use of data in Lean."]
23+
tutorials := #[
24+
%doc TutorialExample.Data,
25+
%doc TutorialExample.HashMap,
26+
literate_part⟨"." TutorialExample.Lit "Literately-Produced Tutorial" {slug := "literate", summary := "checks that we can load them", exampleStyle := .inlineLean `Lit} : Tutorial⟩ |>.toPart]
27+
},
28+
{ title := #[inlines!"Tactics"],
29+
titleString := "Tactics",
30+
description := #[]
31+
tutorials := #[%doc TutorialExample.RCases]
32+
}
33+
34+
]
35+
36+
def main := tutorialsMain content (config := { destination := "_out/tut" })
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/-
2+
Copyright (c) 2025 Lean FRO LLC. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Author: David Thrane Christiansen
5+
-/
6+
import TutorialExample.Data
7+
import TutorialExample.HashMap
8+
import TutorialExample.RCases
9+
-- Important: don't import Lit here

0 commit comments

Comments
 (0)