That;s fair, I think you’re right.
This is the solution I landed on, it seems to get the job done, leaving it here in case folks find it useful:
using Base.Docs: meta, Binding, doc
import Markdown
"""
get_methods_with_docstrings(obj::Union{Union, DataType, Function})
Get the docstring for each method for an object (function/datatype).
"""
function get_methods_with_docstrings(obj::Union{Union, DataType, Function})::Tuple{Vector, Vector}
# get the parent module and the methods list for the object
mod = parentmodule(obj)
mm = methods(obj)
# get the module's multidoc
binding = Binding(mod, Symbol(obj))
dict = meta(mod)
multidoc = dict[binding]
# for each module, attempt to get the docstring as markdown
docstrings = []
for m in mm
# cleanup signature
sig = length(m.sig.types) == 1 ? Tuple{} : Tuple{m.sig.types[2:end]...}
haskey(multidoc.docs, sig) || begin
push!(docstrings, nothing)
end
docs = multidoc.docs[sig].text[1] |> Markdown.parse
push!(docstrings, docs)
end
return mm, docstrings
end