# Why isn't this example function being documented?

**URL:** <https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252>\
**Category:** General Usage\
**Created:** [January 8, 2022, 7:04pm UTC](https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252 "2022-01-08T19:04:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [January 8, 2022, 7:04pm UTC](https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252/1 "2022-01-08T19:04:53Z")

</div>

I am trying to document my functions with mixed results. This simple example, which I pasted on the `julia>` prompt, does not seem to work:

```julia
"""
    foo(x, y)

Some comment.

Another comment.
"""
function foo(x, y)
    return x + y^2
end    

```

What I get is:

```julia
help?> foo
search: foo floor wf_boot_CI portfoliocomposition portfoliocomposition! ft_nonothing

  No documentation found.

  foo is a Function.

  # 1 method for generic function "foo":
  [1] foo(x, y) in Main at REPL[240]:1

```

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![pdeffebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pdeffebach/32/10320_2.png) [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Post date:** [January 8, 2022, 7:06pm UTC](https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252/2 "2022-01-08T19:06:24Z")

</div>

do `? bar` instead of `? bar(x, y)`

---

<div class="post-metadata">

**Author:** ![Soldalma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/soldalma/32/29388_2.png) [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Post date:** [January 8, 2022, 7:15pm UTC](https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252/3 "2022-01-08T19:15:42Z")

</div>

A simplified version, with “foo” instead of “bar”, still does not work:

```julia
help?> foo
search: foo floor wf_boot_CI portfoliocomposition portfoliocomposition! ft_nonothing

  No documentation found.

  foo is a Function.

  # 1 method for generic function "foo":
  [1] foo(x, y) in Main at REPL[240]:1

```

---

<div class="post-metadata">

**Author:** ![Noel\_Araujo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/noel_araujo/32/4862_2.png) [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Post date:** [January 8, 2022, 7:19pm UTC](https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252/4 "2022-01-08T19:19:42Z")

</div>

I cannot reproduce your issue, i just copied and pasted your code, and it works as expected for me (Julia v1.7.1 on Linux)

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [January 8, 2022, 11:13pm UTC](https://discourse.julialang.org/t/why-isnt-this-example-function-being-documented/74252/5 "2022-01-08T23:13:32Z")

</div>

Make sure that you paste the code as one piece. It might happen that the multi-line string and the function definition get evaluated separately when you paste the code line by line.
