Closed JeffFessler closed 1 year ago
I've concluded that my impression that each Literate example is run in its own Julia session must be incorrect, so I've gone ahead and added default()
resets to my examples, so the links above will no longer illustrate the issue. Feel free to close the issue unless the question raises a concern that you want to address.
Yea that is correct. It runs in it's own module namespace, but process global settings will be shared. This is the same whether you use Literate or Documenter for the execution. If you use Literate for execution it is probably easier to setup new processes for each new notebook, something like
run(`julia -e 'using Literate; Literate.notebook(...)'`)
isn't so bad. If you have many examples this might also be a nice way to parallelize it.
run(`julia -e 'using Literate; Literate.notebook(...)'`)
To make sure I understand, you mean in
docs/make.jl
, right? There I could replace the loop where I callLiterate.markdown(...; documenter=execute)
with calls torun
, probably inside aThreads.foreach
to get parallelism. I might try it!
I have a collection of Literate examples for a book I am writing here: https://jefffessler.github.io/book-mmaj-demo/ In one of the examples I use
Plots.default
to setaspect_ratio=:equal
https://jefffessler.github.io/book-mmaj-demo/generated/demos/04/ls-cost1/ Unexpectedly, that default setting seems to affect every Literate example that follows, which messes up the plots in the later examples, e.g., https://jefffessler.github.io/book-mmaj-demo/generated/demos/06/lr-sure/ This is unexpected (to me) because I thought that each Literate example is run in its own fresh Julia session. If needed, I could add a call toPlots.default()
to reset the defaults at the end of every example, but I really don't understand why the plots "state" is persisting from one Literate example to the next. Perhaps this is a Documenter question?