Skip to content

Commit 11adeee

Browse files
Fixes @doc
1 parent f22a871 commit 11adeee

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DocumenterQuarto"
22
uuid = "73f83fcb-c367-40db-89b6-8fd94701aaf2"
33
authors = ["Joey Carpinelli <joey@loopy.codes>"]
4-
version = "0.3.0"
4+
version = "0.3.1"
55

66
[deps]
77
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"

docs/src/_static/versions.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
const li = document.createElement('li');
6868
const a = document.createElement('a');
6969
a.className = 'dropdown-item';
70-
a.href = `../${version}/index.html`;
70+
a.href = `/DocumenterQuarto.jl/${version}/index.html`;
7171

7272
// Wrap version text in a <code> element
7373
const code = document.createElement('code');

src/DocumenterQuarto.jl

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,16 @@ import DocumenterQuarto: @doc
418418
```
419419
"""
420420
macro doc(expr)
421+
clean_expr = strip(replace(string(expr), r"#=.*?=#"s => ""))
422+
header = Markdown.Header{2}("`$clean_expr`")
421423
quote
422424
let docmd = Base.Docs.@doc($expr)
423-
DocumenterQuarto.process(docmd)
425+
Markdown.MD(
426+
$header,
427+
Markdown.parse(":::{.callout appearance=\"minimal\"}"),
428+
DocumenterQuarto.process(docmd),
429+
Markdown.parse(":::")
430+
)
424431
end
425432
end
426433
end

test/runtests.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,8 @@ Returns "String".
6262
f(::String) = "String"
6363

6464
@testset "Macros" begin
65-
@test DocumenterQuarto.@doc(_type_instance) == Base.Docs.@doc(_type_instance)
66-
@test string(DocumenterQuarto.@doc(f)) == "Returns \"Int\".\n\nReturns \"String\".\n"
67-
@test string(DocumenterQuarto.@doc(f(::Int))) == "Returns \"Int\".\n"
68-
@test string(DocumenterQuarto.@doc(f(::String))) == "Returns \"String\".\n"
69-
65+
@test DocumenterQuarto.@doc(_type_instance) isa Markdown.MD
66+
@test DocumenterQuarto.@doc(f) isa Markdown.MD
67+
@test DocumenterQuarto.@doc(f(::Int)) isa Markdown.MD
68+
@test DocumenterQuarto.@doc(f(::String)) isa Markdown.MD
7069
end

0 commit comments

Comments
 (0)