# Weave: how to get different output for notebook vs html

**URL:** <https://discourse.julialang.org/t/weave-how-to-get-different-output-for-notebook-vs-html/74187>\
**Category:** General Usage\
**Tags:** weave\
**Created:** [January 7, 2022, 12:01pm UTC](https://discourse.julialang.org/t/weave-how-to-get-different-output-for-notebook-vs-html/74187 "2022-01-07T12:01:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![oxinabox](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oxinabox/32/206603_2.png) [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Post date:** [January 7, 2022, 12:01pm UTC](https://discourse.julialang.org/t/weave-how-to-get-different-output-for-notebook-vs-html/74187/1 "2022-01-07T12:01:02Z")

</div>

I am using Weave to generate various literate outputs from julia code.  
Depending on the output i want slightly different code to run.

Interact.jl doesn’t work in HTML output, but does work in jupyter.  
So for my interactive plots I want to use Interact.jl to make them show configurably when i generate a jupyter notebook.  
But if i am generating HTML, then I want to not use interact but display a grid of subplots.  
How can this be done?

---

<div class="post-metadata">

**Author:** ![lferrant](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lferrant/32/22751_2.png) [@lferrant](https://discourse.julialang.org/u/lferrant)\
**Post date:** [January 10, 2022, 12:18pm UTC](https://discourse.julialang.org/t/weave-how-to-get-different-output-for-notebook-vs-html/74187/2 "2022-01-10T12:18:01Z")

</div>

Maybe not an useful answer, but as far as I know, it is not possible to do it Weave (maybe I’m wrong and we both learn something 🙂 ). Literate.jl allows you to filter lines by output e.g.

```julia
#md a = 1 # executed only when the output is markdown
#nb a = 2 # executed only when the output is a jupyter notebook

```

I use that trick for the plots in [https://juliaintervals.github.io/](https://juliaintervals.github.io/)

Literate does not directly generate html, but if the final html is meant to go to a webpage created with Documenter/Franklin, then the integration is pretty smooth.
