Documenter.jl icon indicating copy to clipboard operation
Documenter.jl copied to clipboard

[FR] New code block with displayed output but hidden code

Open kapple19 opened this issue 2 years ago • 1 comments

Long code blocks are a pain to # hide every line.

The easiest alternative I can think of is a hidden @setup <name> block that defines a variable with the desired printed output result, then a following @example <name> that calls the variables with # hide and outputs it. But to do that several times for multiple code blocks is a pain.

P.S. Otherwise block options like Weave.jl does.

kapple19 avatar Sep 23 '21 02:09 kapple19

I think the at-eval block does what you need?

mortenpi avatar Mar 24 '22 02:03 mortenpi

Thanks @mortenpi

I couldn't find any info on an "at-eval" block in your link, do you know where I can find it?

I tried Google-searching it as well.

kapple19 avatar Jun 11 '23 14:06 kapple19

It links directly to it. If it doesn't jump to the right section somehow, then you can also click on "@eval block" heading in the sidebar.

mortenpi avatar Jun 11 '23 23:06 mortenpi

Ah, my bad, I misinterpreted "at-eval" thinking it was different from @eval.

Thanks, but @eval block doesn't hide every line of code in the block. I guess I'll stick to # hideing every line.

kapple19 avatar Jun 27 '23 04:06 kapple19

Thanks, but @eval block doesn't hide every line of code in the block.

With at-eval, the input code should always be completely removed.

mortenpi avatar Jun 27 '23 05:06 mortenpi