# How to access docstrings without REPL

**URL:** https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422
**Category:** General Usage
**Tags:** documentation
**Created:** [June 5, 2021, 10:20am UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422 "2021-06-05T10:20:02Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)
#### Post date: [June 5, 2021, 10:20am UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/1 "2021-06-05T10:20:02Z")

</div>

The user guide describes clearly how to access the docstring of a function via the help mode of the REPL. But how can I access the docstring without the REPL (from a program)?

---

<div class="post-metadata">

### Author: ![rikh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rikh/32/204104_2.png) [@rikh](https://discourse.julialang.org/u/rikh)
#### Post date: [June 5, 2021, 10:32am UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/2 "2021-06-05T10:32:14Z")

</div>

I’m not sure what you mean exactly by not using the REPL. Do you mean from within the IDE that you are using?

If you mean accessing it via code, then use `@doc`. For example:

```julia
julia> @doc Int
  Int64 <: Signed

  64-bit signed integer type.

```

---

<div class="post-metadata">

### Author: ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)
#### Post date: [June 5, 2021, 10:52am UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/3 "2021-06-05T10:52:51Z")

</div>

Thanks, yes, that is what I meant. This helps.

BTW, I can’t really find much in the official documentation, but it must be somewhere. Do you know where? I get no direct hits when I search for @doc.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 5, 2021, 11:00am UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/4 "2021-06-05T11:00:59Z")

</div>

The doc search isn’t always great, but here’s a docstring:

```julia
help?> @doc
  Documentation
  ≡≡≡≡≡≡≡≡≡≡≡≡≡≡≡

  Functions, methods and types can be documented by placing a string before the definition:

  """
  # The Foo Function
  `foo(x)`: Foo the living hell out of `x`.
  """
  foo(x) = ...

  The @doc macro can be used directly to both set and retrieve documentation / metadata. The macro has special parsing so  
  that the documented object may occur on the next line:

  @doc "blah"
  function foo() ...

  By default, documentation is written as Markdown, but any object can be used as the first argument.

  Documenting objects after they are defined
  ============================================

  You can document an object after its definition by

  @doc "foo" function_to_doc
  @doc "bar" TypeToDoc

  For macros, the syntax is @doc "macro doc" :(@Module.macro) or @doc "macro doc" :(string_macro"") for string macros.     
  Without the quote :() the expansion of the macro will be documented.

  Retrieving Documentation
  ==========================

  You can retrieve docs for functions, macros and other objects as follows:

  @doc foo
  @doc @time
  @doc md""

  Functions & Methods
  =====================

  Placing documentation before a method definition (e.g. function foo() ... or foo() = ...) will cause that specific       
  method to be documented, as opposed to the whole function. Method docs are concatenated together in the order they were
  defined to provide docs for the function.

```

---

<div class="post-metadata">

### Author: ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)
#### Post date: [June 5, 2021, 11:25am UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/5 "2021-06-05T11:25:30Z")

</div>

Thanks, but I was wondering where on [Julia Documentation · The Julia Language](https://docs.julialang.org/en/v1/) this is documented.

(There’s a small irony here, looking for information on _not_ using the REPL help by using the REPL help…)

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [June 5, 2021, 12:41pm UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/6 "2021-06-05T12:41:15Z")

</div>

There’s a mention here:

[https://docs.julialang.org/en/v1/base/base/#Base.Docs](https://docs.julialang.org/en/v1/base/base/#Base.Docs)

Most discussion on usage seems to be in the “Advanced usage” section of the documentation documentation:

[https://docs.julialang.org/en/v1/manual/documentation/#Advanced-Usage](https://docs.julialang.org/en/v1/manual/documentation/#Advanced-Usage)

---

<div class="post-metadata">

### Author: ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)
#### Post date: [June 5, 2021, 1:27pm UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/7 "2021-06-05T13:27:31Z")

</div>

Great, thanks!

---

<div class="post-metadata">

### Author: ![reinermartin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/reinermartin/32/25574_2.png) [@reinermartin](https://discourse.julialang.org/u/reinermartin)
#### Post date: [June 11, 2021, 9:44pm UTC](https://discourse.julialang.org/t/how-to-access-docstrings-without-repl/62422/8 "2021-06-11T21:44:17Z")

</div>

@ [nilshg](https://discourse.julialang.org/u/nilshg), I just learned today that you’re a friend of MN with whom I work closely! Small world
