-
Notifications
You must be signed in to change notification settings - Fork 119
Expand file tree
/
Copy pathGenericCode.lean
More file actions
95 lines (81 loc) · 2.31 KB
/
Copy pathGenericCode.lean
File metadata and controls
95 lines (81 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
/-
Copyright (c) 2023 Lean FRO LLC. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Author: David Thrane Christiansen
-/
import Verso
namespace Verso.GenericCodeTest
set_option guard_msgs.diff true
set_option pp.rawOnError true
/- ----- -/
#docs (.none) code1 "More writing" :=
:::::::
# Section 1
Here's some code
```
(define (zero f z) z)
(define (succ n) (lambda (f x) (f (n f z))))
```
:::::::
/--
info: Verso.Doc.Part.mk
#[Verso.Doc.Inline.text "More writing"]
"More writing"
none
#[]
#[Verso.Doc.Part.mk
#[Verso.Doc.Inline.text "Section 1"]
"Section 1"
none
#[Verso.Doc.Block.para #[Verso.Doc.Inline.text "Here's some code"],
Verso.Doc.Block.code "(define (zero f z) z)\n(define (succ n) (lambda (f x) (f (n f z))))\n"]
#[]]
-/
#guard_msgs in
#eval code1.force
/--
info: Verso.Output.Html.tag
"section"
#[]
(Verso.Output.Html.seq
#[Verso.Output.Html.tag "h1" #[] (Verso.Output.Html.seq #[Verso.Output.Html.text true "More writing"]),
Verso.Output.Html.tag
"section"
#[]
(Verso.Output.Html.seq
#[Verso.Output.Html.tag "h2" #[] (Verso.Output.Html.seq #[Verso.Output.Html.text true "Section 1"]),
Verso.Output.Html.tag "p" #[] (Verso.Output.Html.seq #[Verso.Output.Html.text true "Here's some code"]),
Verso.Output.Html.tag
"pre"
#[]
(Verso.Output.Html.text true "(define (zero f z) z)\n(define (succ n) (lambda (f x) (f (n f z))))\n")])])
-/
#guard_msgs in
#eval Doc.Genre.none.toHtml (m:=Id) {logError := fun _ => ()} () () {} {} {} code1.force |>.run .empty |>.fst
/- ----- -/
#docs (.none) code2 "More code writing" :=
:::::::
# Section 1
Here's some `code`!
```
(define (zero f z) z)
(define (succ n) (lambda (f x) (f (n f z))))
```
:::::::
/--
info: Verso.Doc.Part.mk
#[Verso.Doc.Inline.text "More code writing"]
"More code writing"
none
#[]
#[Verso.Doc.Part.mk
#[Verso.Doc.Inline.text "Section 1"]
"Section 1"
none
#[Verso.Doc.Block.para
#[Verso.Doc.Inline.text "Here's some ", Verso.Doc.Inline.code "code", Verso.Doc.Inline.text "!"],
Verso.Doc.Block.code "(define (zero f z) z)\n(define (succ n) (lambda (f x) (f (n f z))))\n"]
#[]]
-/
#guard_msgs in
#eval code2.force