Weave: how to get different output for notebook vs html

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?

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 :slight_smile: ). Literate.jl allows you to filter lines by output e.g.

#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/

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.