Makedocs: Undefined binding

When I run makedocs() I get the error message:

!! Undefined binding 'myfunction'. [src\funlist.md]

I’m not able to find the error. Is there a common cause for this error?

Thanks.

I am guessing that myfunction is not exported, so it’s not available in the scope where makedocs gets called. There was a similar question posted on Documenter’s issue tracker just recently: https://github.com/JuliaDocs/Documenter.jl/issues/489

“I am guessing that myfunction is not exported”

I checked this. No, ‘myfunction’ is exported.

Moreover, all exported functions get this error.
I think this might be a path problem and makedocs
does not find the functions.

So what does “undefined binding” means exactly?
And how do I define a ‘binding’?

Binding in this case means the particular name within a module that the function is associated with (but it might not be the most accurate terminology). The module and functions that makedocs has to find have to be imported into the module that calls makedocs. Is myfunction imported into the module that calls makedocs with e.g. a using statement?

1 Like

“Is myfunction imported into the module that calls makedocs with e.g. a using statement?”

Thanks! This solved the problem. I was perhaps misguided by the docs of Documenter
which reads:

using Documenter
makedocs(
    # keywords...
)

Shouldn’t it be then

using Documenter, MyModule
makedocs(
    # keywords...
)

That particular example block should perhaps be removed, because it doesn’t really add to the surrounding text. And the text could probably be clarified to say that the functions & modules that will be used in the docs should be imported. There’s a better, more thorough example in the manual: Guide · Documenter.jl