fredrikekre / Literate.jl

Simple package for literate programming in Julia
https://fredrikekre.github.io/Literate.jl
Other
536 stars 62 forks source link

Literate generating @example blocks when it shouldn't #253

Open MarkNahabedian opened 3 days ago

MarkNahabedian commented 3 days ago

In https://github.com/MarkNahabedian/MattParkerJigsawPuzzleProblem.jl I'm trying to use Literate and Documenter to generate documentation.

The docs/make.jl script first walks the source hierarchy and uses Literate.markdown to process each Julia source file and write a corresponding markdown file to docs/src. Those .md files are codefenced with @example blocks. Attemptinig to execute those blocks causes Documenter to fail.

In the documentation for Literate.DEFAULT_CONFIGURATION, the explanations for codefence and execute seem inconsistent in that execute should not be true for Markdown files.

Also, in this function https://github.com/fredrikekre/Literate.jl/blob/90b24681a77ccb2ca6ae453e892f589354319c30/src/Literate.jl#L305 it seems to me that the sense of the conditional is inverted from what it should be -- To use @example if execute is true.

fredrikekre commented 1 day ago

The execute arg determines if Literate should execute the block or not, not whether Documenter later will try to do it.