# Documenter With Nested Modules

**URL:** <https://discourse.julialang.org/t/documenter-with-nested-modules/69702>\
**Category:** General Usage\
**Tags:** documenter\
**Created:** [October 13, 2021, 5:10pm UTC](https://discourse.julialang.org/t/documenter-with-nested-modules/69702 "2021-10-13T17:10:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luapulu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/luapulu/32/17669_2.png) [@Luapulu](https://discourse.julialang.org/u/Luapulu)\
**Post date:** [October 13, 2021, 5:10pm UTC](https://discourse.julialang.org/t/documenter-with-nested-modules/69702/1 "2021-10-13T17:10:58Z")

</div>

I have a package, which looks something like

```julia
module MyPackage
    module Sub1
        module SubSub1
            # some code
        end
        # some code
    end

    module Sub2

    end
end

```

When I try to run doctests I keep running into the following two errors

```julia
┌ Warning: Failed to evaluate `CurrentModule = SubSub1` in `@meta` block.
│ err = UndefVarError: SubSub1 not defined
└ @ Documenter.DocTests ~/.julia/packages/Documenter/XIxke/src/DocTests.jl:101

```

which I get in the docs file corresponding to `SubSub1` where I have

```julia
CurrentModule = SubSub1
DocTestSetup = quote
    using MyPackage
    using .MyPackage.Sub1.SubSub1
end

```

(I don’t know how to escape the backticks)

and in the doctests I get

```julia
ERROR: UndefVarError: thing in SubSub1 not defined
Stacktrace:
  [1] top-level scope
  @ none:1

```

Can somebody tell me how to get Documenter to load the modules deeper inside my package so they are available to use in the `@meta` block for `CurrentModule = SubSub1` and how to load them so they are available in the doctests themselves? I’ve tried many combinations and none seem to work.
