# Display @code\_warntype output in docs

**URL:** https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264
**Category:** General Usage
**Tags:** documentation, documenter, code\_warntype
**Created:** [February 27, 2023, 11:03am UTC](https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264 "2023-02-27T11:03:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [February 27, 2023, 11:03am UTC](https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264/1 "2023-02-27T11:03:40Z")

</div>

Hi!  
How would one go about displaying the output of `@code_warntype` in a Documenter-generated webpage?  
From what I can tell, there are two obstacles:

- `@code_warntype` prints its output in the REPL instead of returning it (probably easy to overcome)
- I sometimes encountered a weird error to the tune of “`code_warntype` not defined” when trying to expand Markdown files. I generate these Markdown files from Literate.jl, so the MWE is a bit tedious but if no one has encountered this error I can try to come up with one

---

<div class="post-metadata">

### Author: ![ffevotte](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffevotte/32/6587_2.png) [@ffevotte](https://discourse.julialang.org/u/ffevotte)
#### Post date: [February 27, 2023, 11:08am UTC](https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264/2 "2023-02-27T11:08:53Z")

</div>

> [@gdalle](#):
>
> I sometimes encountered a weird error to the tune of “`code_warntype` not defined” when trying to expand Markdown files. I generate these Markdown files from Literate.jl, so the MWE is a bit tedious but if no one has encountered this error I can try to come up with one

I think this is because `@code_warntype` is exported by `InteractiveUtils`, which is loaded by default only in interactive sessions. An explicit `using InteractiveUtils` somewhere in your code should solve the issue.

---

<div class="post-metadata">

### Author: ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)
#### Post date: [February 27, 2023, 2:25pm UTC](https://discourse.julialang.org/t/display-code-warntype-output-in-docs/95264/3 "2023-02-27T14:25:35Z")

</div>

Sounds like the solution, thanks!
