Lyceum / LyceumDocs.jl

Documentation for the Lyceum ecosystem
MIT License
4 stars 0 forks source link

Add ability to include source without executing #13

Open colinxs opened 4 years ago

colinxs commented 4 years ago

Literate wraps code in Documenter @example blocks when documenter=true, so add the ability to generate normal Julia blocks for source we want included in generated markdown/scripts/notebooks but don't want to execute during build process.

colinxs commented 4 years ago

@klowrey Found a workaround

# Now just call the function to see the visualizer appear!
#md # ```julia
#md # viz_hopper_NPG()
#md # ```
#jl viz_hopper_NPG()
#nb viz_hopper_NPG()

#md # You should see the following:
#md # ![visualizer](visualize.png)

Which would leave just the line viz_hopper_NPG() in the generated Julia scripts and Jupyter notebooks, and a formatted, un-executed code block in the Markdown.

For reference, Literate.jl by default would take

viz_hopper_NPG()

and generate:

```@example
viz_hopper_NPG()

which gets executed when docs are built.