Stream: helpdesk (published)

Topic: Running external commands in Documenter.jl `@example` block


view this post on Zulip Hugo Levy-Falk (Jan 14 2026 at 22:18):

Hello, I am trying to run the following @example block in a Documenter page:

pinocchio = PipeBuffer()
listener = run(`go-sendxmpp -n -p plopiplop -u pinocchio@localhost -l`, devnull, pinocchio, stderr, wait = false)

But the Documenter process hangs when generating the example (the last Documenter Debug output is this block). Everything runs smoothly when I just execute the code manually. Are there any limitations on running external programs asynchronously in Documenter?

Thanks!

view this post on Zulip Mosè Giordano (Jan 15 2026 at 02:25):

Does the command depend on where you run it? I seem to remember Documenter changes the working directory under your feet

view this post on Zulip Hugo Levy-Falk (Jan 15 2026 at 08:17):

Hi, unfortunately, no the command does not depend on the current directory

view this post on Zulip Hugo Levy-Falk (Jan 18 2026 at 16:17):

Ok, I finally have something working using pipeline: https://discourse.julialang.org/t/documenter-jl-running-external-commands-asynchronously-in-example-blocks/135085/2?u=klafyvel (not entirely sure why this works)

view this post on Zulip Mosè Giordano (Jan 18 2026 at 21:53):

Ah, maybe Documenter tries to capture the output?

view this post on Zulip Hugo Levy-Falk (Jan 18 2026 at 22:01):

Yes, I think it is something along this line now that you mention it, probably the stderr in the original run!

view this post on Zulip Mosè Giordano (Jan 18 2026 at 22:08):

Looks like it: https://github.com/JuliaDocs/Documenter.jl/blob/3b85898481e8f32f3f14a775c3aba22d1c12fde8/src/expander_pipeline.jl#L861

view this post on Zulip Hugo Levy-Falk (Jan 18 2026 at 22:08):

Indeed!


Last updated: Jan 28 2026 at 04:59 UTC