File tree Expand file tree Collapse file tree
verso-literate/VersoLiterate
test-projects/literate-config/LitConfig Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,6 +224,9 @@ private def testAllBuiltinDocRoles (data : TestData) : IO Unit := withTestDir da
224224 unless hasSubstring jsonContent "\" content\" :\" lhs\" ,\" kind\" :{\" keyword\" :{\" docs\" :\" " do
225225 throw <| IO.userError "Builtins JSON has no docs on the `lhs` keyword token. \
226226 The conv handler did not attach the syntax kind's docstring."
227+ unless hasSubstring jsonContent "{\" content\" :\" funext\" ,\" kind\" :{\" keyword\" :{\" docs\" :\" " do
228+ throw <| IO.userError "Builtins JSON has no docs on the `funext` keyword token. \
229+ The kw handler did not attach the syntax kind's docstring."
227230
228231/--
229232Checks that user-registered `@[inline_to_literate]` and `@[block_to_literate]` handlers shadow the
Original file line number Diff line number Diff line change @@ -173,12 +173,13 @@ def handleConvTactic : InlineToLiterate
173173 | _, _, _ => pure none
174174
175175def handleKwAtom : InlineToLiterate
176- | name, _val, content => do
177- -- Data.Atom is mistakenly marked private in Lean. Here's a workaround until we fix that.
178- -- Check the name's suffix because private names have a mangled prefix:
179- unless name.toString.endsWith "Lean.Doc.Data.Atom" do return none
180- let some s := (match content with | #[.code s] => some s | _ => none) | return none
181- return some <| .other (.highlighted <| .token ⟨.keyword none none none, s⟩) content
176+ | ``Lean.Doc.Data.Atom, val, content => do
177+ if let some { name, .. } := val.get? Lean.Doc.Data.Atom then
178+ let #[.code s] := content | return none
179+ let docs ← findDocString? (← getEnv) name
180+ return some <| .other (.highlighted <| .token ⟨.keyword (some name) none docs, s⟩) content
181+ throwError "Wrong data"
182+ | _, _, _ => pure none
182183
183184def handleSyntax : InlineToLiterate
184185 | ``Lean.Doc.Data.Syntax, val, content => do
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ set_option doc.verso.suggestions false in
3131
3232{syntaxCat}`term` is a syntax category, and {syntax term}`1 + [] - (· / ·)` is syntax in it.
3333
34- {kw (of := Lean.«command__Unif_hint____Where_|_-⊢__»)}`unif_hint ` is a keyword atom.
34+ {kw}`funext ` is a keyword atom.
3535{kw? (of := Lean.«command__Unif_hint____Where_|_-⊢__»)}`where` is also a keyword atom, and
3636{kw! (of := Lean.Parser.Command.definition)}`def` is an unchecked keyword atom.
3737
You can’t perform that action at this time.
0 commit comments