Skip to content

Commit c132464

Browse files
committed
chore: adopt new macros for {block,inline}_extension
1 parent b718656 commit c132464

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

Manual/ErrorExplanations.lean

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,8 @@ set_option pp.rawOnError true
1515
set_option guard_msgs.diff true
1616

1717

18-
def Inline.errorExplanationLink (errorName : Name) : Manual.Inline where
19-
name := `Manual.Inline.errorExplanationLink
18+
inline_extension Inline.errorExplanationLink (errorName : Name) where
2019
data := toJson errorName
21-
22-
@[inline_extension Inline.errorExplanationLink]
23-
def Inline.errorExplanationLink.descr : InlineDescr where
2420
traverse := fun _ _ _ => pure none
2521
toTeX := none
2622
toHtml := some fun go _ data content =>

Manual/Meta/ErrorExplanation.lean

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,12 @@ def explanationMWE : CodeBlockExpander
6262
(Block.lean $(quote hls) (some $(quote (← getFileName))) none)
6363
#[Block.code $str])]
6464

65-
/--
65+
/-
6666
A tabbed container for MWEs in an error explanation example. Must satisfy the
6767
invariant that `titles.size` is equal to the number of children of this block.
6868
-/
69-
def Block.tabbedMWEs (titles : Array String) : Block where
70-
name := `Manual.Block.tabbedMWEs
69+
block_extension Block.tabbedMWEs (titles : Array String) where
7170
data := toJson titles
72-
73-
@[block_extension Block.tabbedMWEs]
74-
def Block.tabbedMWEs.descr : BlockDescr where
7571
traverse id data _blocks := do
7672
let name :=
7773
match FromJson.fromJson? (α := Option String) data with
@@ -550,12 +546,8 @@ def addExplanationBodyBlocks : ExplanElabM Unit := do
550546

551547
deriving instance Quote for ErrorExplanation.Metadata
552548

553-
def Block.errorExplanationMetadata (metadata : ErrorExplanation.Metadata) : Block where
554-
name := `Manual.Block.errorExplanationMetadata
549+
block_extension Block.errorExplanationMetadata (metadata : ErrorExplanation.Metadata) where
555550
data := toJson metadata
556-
557-
@[block_extension Block.errorExplanationMetadata]
558-
def Block.errorExplanationMetadata.descr : BlockDescr where
559551
traverse _ _ _ := pure none
560552
toTeX := none
561553
extraCss := ["

0 commit comments

Comments
 (0)