# Remove inner module function name with @docs in Documenter.jl

**URL:** <https://discourse.julialang.org/t/remove-inner-module-function-name-with-docs-in-documenter-jl/61617>\
**Category:** General Usage\
**Tags:** question, package, documenter, syntax\
**Created:** [May 22, 2021, 1:16am UTC](https://discourse.julialang.org/t/remove-inner-module-function-name-with-docs-in-documenter-jl/61617 "2021-05-22T01:16:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MattWillFlood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattwillflood/32/20722_2.png) [@MattWillFlood](https://discourse.julialang.org/u/MattWillFlood)\
**Post date:** [May 22, 2021, 1:16am UTC](https://discourse.julialang.org/t/remove-inner-module-function-name-with-docs-in-documenter-jl/61617/1 "2021-05-22T01:16:52Z")

</div>

Hi Guys, 🙂

I’m creating documentation for a package using Documenter.jl 👨🏻‍🏫 👩🏻‍🏫, and I’m loving the efficiency that the @docs macro provides. 🙌🏻  
However, in trying to make my documentation as user friendly as possible, I’ve hit a snag.

When I add this to my markdown file:

```julia
` ` `@docs
MyPackage.b
` ` `

```

the function syntax text that gets published in the respective html file looks like this:

[`MyPackage.B.b`](#MyPackage.B.b)—Function

where the source docstring is, when instead I want it to look like this:

[`MyPackage.b`](#MyPackage.b)—Function

As I want users of my package to call `MyPackage.b()`, or just `b()`, is there a way to exclude the inner module name (`B`) using Documenter? 🤔

_I’ve played around with the main package module, trying to_ @reexport _the function_ **b** _from_ **B** _to_ **MyPackage** _directly, but as the original docstring belongs to a function_ ( **b** ) _in the inner module_ **B** , _it doesn’t solve my problem._ 🤷🏻‍♂️

If it’s any help, the main package module looks something like this:

```julia
module MyPackage
export b

include("./B.jl")
using .B: b
end

```

If anyone can offer a solution, I would be _soooooo_ grateful 🙏🏻 🙏🏻 🙏🏻 😊

Thanks!  
M

---

<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:** [June 29, 2021, 8:02am UTC](https://discourse.julialang.org/t/remove-inner-module-function-name-with-docs-in-documenter-jl/61617/2 "2021-06-29T08:02:00Z")

</div>

Documenter is reflecting the situation accurately, i.e. that `b` is a function in module `MyPackage.B`. If you want the binding to belong to `MyPackage` directly, you should define it there. For example, you could organize the code as follows:

```julia
module MyPackage
  function b end
  module B
    import ..MyPackage: b
    # methods of b, including their docstrings, can live here
  end
end

```

Although I don’t know the exact case, I have a hunch that if you want `b` to be in the top level, then having `B` as a separate module is probably redundant and is creating unnecessary complexity. So the best solution might be to get rid of `B` altogether.

---

<div class="post-metadata">

**Author:** ![MattWillFlood](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mattwillflood/32/20722_2.png) [@MattWillFlood](https://discourse.julialang.org/u/MattWillFlood)\
**Post date:** [July 3, 2021, 10:09am UTC](https://discourse.julialang.org/t/remove-inner-module-function-name-with-docs-in-documenter-jl/61617/3 "2021-07-03T10:09:44Z")

</div>

Thanks @mortenpi .

> So the best solution might be to get rid of `B` altogether.

That’s what I thought, but unfortunately isn’t really feasible in my situation.  
Thanks again 🙂
