Skip to content

Commit c62446d

Browse files
authored
[docs] improve the docstrings of the various enum values (#2698)
1 parent 548793f commit c62446d

File tree

2 files changed

+264
-103
lines changed

2 files changed

+264
-103
lines changed

src/MathOptInterface.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,19 +327,24 @@ macro _documented_enum(args...)
327327
$(Expr(:macrocall, Symbol("@enum"), __source__, args[2:2:end]...))
328328
end
329329
main_doc, enum = args[1], args[2]
330-
main_doc *= "\n## Values\n\nPossible values are:\n\n"
330+
main_doc *= "\n## Values\n\n"
331331
for i in 3:2:length(args)
332332
docstr, value = args[i], args[i+1]
333333
doc = """
334334
$value::$enum
335335
336-
An instance of the [`$enum`](@ref) enum.\n\n`$value`: $docstr
336+
An instance of the [`$enum`](@ref) enum.
337+
338+
## About
339+
340+
$docstr
337341
"""
338342
push!(
339343
code.args,
340344
Expr(:macrocall, Symbol("@doc"), __source__, doc, Meta.quot(value)),
341345
)
342-
main_doc *= " * [`$value`](@ref): $docstr\n"
346+
new_docstr = join(split(docstr, "\n"), "\n ")
347+
main_doc *= "### [`$value`](@ref)\n\n$new_docstr\n"
343348
end
344349
push!(
345350
code.args,

0 commit comments

Comments
 (0)