How to use package extensions with Documenter.jl

When I test my documentation locally via LiveServer, Documenter recognizes functions in the extension in the @example macro block. However, the method is not found when the docs are built on Github. Is there a solution?

I found an issue which seems to point to this line of code. I will give that a try and report back.

Edit

That resulted in an error: try to make extensions work with documenter · itsdfish/SequentialSamplingModels.jl@6640cdb · GitHub

Well you are building the docs in 1.8.5, so that means extensions do not yet exist, and I hope the make file above handles this correctly, but I also can not see which version of your makefile is used, since I could not spot which version/PR your are running this on.

Of course on solution is to run the docs on 1.9, but your error message looks a bit like you seem to load TuringExt instead of SequentialSamplingModels.TuringExt and/or you do not have the Rewuires fallback in place (which is also needed on 1.8.x)?

edit: Ah yes I see, in your modules main file you are missing

and you need of course Requires for that, otherwise the extensions would not work in 1.8.x (where Requires.jl was used for that instead). Since you run on 1.8.5 for the docs, the error message is correct your extension does not yet exist pre 1.9

edit 2: changed the code example to a simpler 1-packge extension.

1 Like

Thanks! That was a stupid mistake on my part. I completely forgot that the tests and docs had separate versions.

1 Like

Ah, that was not so easy to spot, that the docs were still running on 1.8 and that the main file was not using Requires – but I am happy that I could help.

1 Like