Why do you want more than one makedocs
call? I thought only the calls to Literate
would have to be in their own environments?
This is what I had in mind:
$ tree .
.
|-- docs
| |-- make.jl
| |-- Manifest.toml
| |-- Project.toml # Documenter, Literate, ...
| `-- src
| `-- literate-src
| |-- example-1
| | |-- Manifest.toml
| | `-- Project.toml # Example-1 specific deps
| `-- example-2
| |-- Manifest.toml
| `-- Project.toml # Example-2 specific deps
|-- Manifest.toml
|-- Project.toml
`-- src
`-- KernelFunctions.jl
And then in make.jl
you would use something like
using Documenter
# Run Literate examples in their own processes
examples = joinpath(@__DIR__, "src", "literate-src")
cmd = Base.julia_cmd()
docs_env = @__DIR__
for example in readdir(examples; join=true)
load_path = "$(example):$(docs_env)"
code = """
using Literate
Literate.markdown(...)
"""
run(addenv(`$(cmd) -e $(code)`, Dict("JULIA_LOAD_PATH" => load_path)))
end
makedocs(
# ...
)
deploydocs(
# ...
)