# How to use package extensions with Documenter.jl

**URL:** <https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704>\
**Category:** General Usage\
**Tags:** documenter, package-extensions\
**Created:** [October 7, 2023, 4:45pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704 "2023-10-07T16:45:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [October 7, 2023, 4:45pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704/1 "2023-10-07T16:45:43Z")

</div>

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](https://github.com/itsdfish/SequentialSamplingModels.jl/actions/runs/6441831970/job/17492021603#step:5:314). Is there a solution?

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [October 7, 2023, 4:59pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704/2 "2023-10-07T16:59:08Z")

</div>

I found an issue which seems to point to [this line of code](https://github.com/JuliaManifolds/Manifolds.jl/blob/master/docs/make.jl#L72). 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](https://github.com/itsdfish/SequentialSamplingModels.jl/actions/runs/6442472347/job/17493327125#step:5:8)

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [October 7, 2023, 6:12pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704/3 "2023-10-07T18:12:17Z")

</div>

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

> <https://github.com/JuliaManifolds/Manifolds.jl/blob/71cd2aa54591ee35cdbb45af9c810c5c3704e60c/src/Manifolds.jl#L549-L551>

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.

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [October 7, 2023, 8:11pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704/4 "2023-10-07T20:11:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![kellertuer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kellertuer/32/220707_2.png) [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Post date:** [October 7, 2023, 8:55pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions-with-documenter-jl/104704/5 "2023-10-07T20:55:13Z")

</div>

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.
