Skip to content

Commit

Permalink
fix md problem
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Brown committed Dec 8, 2024
1 parent a129cb4 commit 2db4fc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions src/syntax/TheoryInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ function theory_impl(head, body, __module__)
end

doctarget = gensym()
mdp(::Nothing) = []
mdp(x::Base.Docs.DocStr) = Markdown.parse(x.text...)

push!(modulelines, Expr(:toplevel, :(module Meta
struct T end

@doc ($(Markdown.MD)((@doc $(__module__).$doctarget), $docstr))
const theory = $theory

macro theory() $theory end
Expand All @@ -180,7 +181,7 @@ function theory_impl(head, body, __module__)
$(structlines...)
end
),
:(@doc ($(Markdown.MD)((@doc $doctarget), $docstr)) $name)
:(@doc ($(Markdown.MD)($mdp(@doc $doctarget), $docstr)) $name)
)
)
end
Expand Down
5 changes: 3 additions & 2 deletions test/syntax/TheoryInterface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ end
@op 1 + 1
end

@test (@doc ThCMonoid.Meta.theory) isa Markdown.MD
@test (@doc ThSet) == (@doc ThSet.Meta.theory)
# DEPRECATED
# @test (@doc ThCMonoid.Meta.theory) isa Markdown.MD
# @test (@doc ThSet) == (@doc ThSet.Meta.theory)

end

0 comments on commit 2db4fc6

Please sign in to comment.