Is there a way to modify expressions in `Documenter` to remove `rng`

In PlotDocs, we use DemoCards and Literate to generate example plots, and Documenter for rendering docs.

I’d like the generated code to take a rng argument so that the output is more reproducible.
So far this works well (I can modify expressions to take a rng argument) , but the problem is that I don’t want it to appear in the end user documentation.

For examples, taking Lines · Plots, this is what I obtain (note the added rng):

using Plots
Plots.reset_defaults()  #hide

using StableRNGs  #hide
rng = StableRNG(1234)  #hide

plot(Plots.fakedata(rng, 50, 5), w = 3)

# This file was generated using Literate.jl,

Now, I’d like the expression plot(Plots.fakedata(50, 5), w = 3) (without rng) to appear in the html so that it can be copy-pasted by anyone, without having to setup a random number generator.

Is there a way to do that ?

cc @JohnnyChen94, @fredrikekre

Why you do not setup rng in the single place where you write rng so the code is both reproducible and is a single line to be copyed?

We use StableRNGs (to enforce reproducibility across julia versions) and not everyone has StableRNGs in their project.

I’ve edited the example.