# AssertionError: md isa Markdown.MD

**URL:** <https://discourse.julialang.org/t/assertionerror-md-isa-markdown-md/44607>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [August 9, 2020, 9:33am UTC](https://discourse.julialang.org/t/assertionerror-md-isa-markdown-md/44607 "2020-08-09T09:33:43Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![zwwi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zwwi/32/11932_2.png) [@zwwi](https://discourse.julialang.org/u/zwwi)\
**Post date:** [August 9, 2020, 9:33am UTC](https://discourse.julialang.org/t/assertionerror-md-isa-markdown-md/44607/1 "2020-08-09T09:33:43Z")

</div>

I wanted to generate documentation for a project. I have a `make.jl` under the `docs` directory generated by `PkgTemplate` like the following:

```julia
using Documenter
using MyModule

makedocs(;
    modules=[MyModule],
    authors="author",
    repo="https://github.com/user/MyModule.jl/blob/{commit}{path}#L{line}",
    sitename="MyModule.jl",
    format=Documenter.HTML(;
        prettyurls=get(ENV, "CI", "false") == "true",
        canonical="https://user.github.io/MyModule.jl",
        assets=String[],
    ),
    pages=[
        "Home" => "index.md",
    ],
)

deploydocs(;
    repo="github.com/user/MyModule.jl"
)

```

`julia make.jl` gave me the following error

```julia
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
ERROR: LoadError: AssertionError: md isa Markdown.MD
Stacktrace:
... ...

```

I compared with another project for which I succeeded in making documentation, but could not figure out what went wrong here.  
Suggestions are really appreciated. Thanks.

---

<div class="post-metadata">

**Author:** ![zwwi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zwwi/32/11932_2.png) [@zwwi](https://discourse.julialang.org/u/zwwi)\
**Post date:** [August 9, 2020, 11:10am UTC](https://discourse.julialang.org/t/assertionerror-md-isa-markdown-md/44607/2 "2020-08-09T11:10:17Z")

</div>

I find out that it was due to I used `LazyHelp` from `PyPlot` to get the docstring from the Python module that was imported to my project.

I have sth. like the following in my module (copied from [`PyPlot.jl`](https://github.com/JuliaPy/PyPlot.jl/blob/master/src/PyPlot.jl)):

```julia
for f in plt_funcs
    sf = string(f)
    @eval @doc LazyHelp(plt,$sf) function $f(args...; kws...)
        if !hasproperty(plt, $sf)
            error("matplotlib ", version, " does not have pyplot.", $sf)
        end
        return pycall(plt.$sf, PyAny, args...; kws...)
    end
end

```

If I comment out this part, then the documentation can be successfully generated. If there a way to proceed without commenting out this part?

---

<div class="post-metadata">

**Author:** ![mortenpi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mortenpi/32/158_2.png) [@mortenpi](https://discourse.julialang.org/u/mortenpi)\
**Post date:** [August 10, 2020, 12:09am UTC](https://discourse.julialang.org/t/assertionerror-md-isa-markdown-md/44607/3 "2020-08-10T00:09:02Z")

</div>

It looks like that the docstring that `LazyHelp` attaches is not a `Markdown.MD` and that confuses Documenter. But it’s not immediately obvious where things are going wrong.

I would encourage you to open an issue [for Documenter](https://github.com/JuliaDocs/Documenter.jl/issues) – minimally, we should turn that assertion into a more helpful error. It would help to have a small, isolated example to reproduce this (e.g. a simple module that one could run separately of any dependencies etc.)

---

<div class="post-metadata">

**Author:** ![zwwi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/zwwi/32/11932_2.png) [@zwwi](https://discourse.julialang.org/u/zwwi)\
**Post date:** [August 10, 2020, 2:44am UTC](https://discourse.julialang.org/t/assertionerror-md-isa-markdown-md/44607/4 "2020-08-10T02:44:52Z")

</div>

issue opened [for Documenter](https://github.com/JuliaDocs/Documenter.jl/issues/1394).
