Literate.jl
Literate.jl copied to clipboard
Custom code fence per code block
According to the docs,
The default code fence will change from
```julia # code ```to Documenters @example blocks:
```@examples $(name) # code ```
And in the config, I noticed that this can be changed with codefence.
However, I would like to use a different fence only a single code block, which should read
```@cast
# code
```
to use Asciicast.jl. See the docs here. Of course, I don't want all blocks to generate Asciinema output.
Is this currently possible?
You can do
# ```@cast
# # code
# ```
Cool! But then I would have to do something like
# ```@cast
# my_code()
# ```
my_code() #!md
so that my_code() is
- run when I include the file,
- included in the notebook and
- not executed twice in Documenter.jl.
Right?
Yes. If you have more code that depends on this I think you need to evaluate it twice anyway (otherwise the variables won't be in the same anonymous module).