Yes of course, I have updated with a link to the actual notebook instead to make this clearer.
I tried out Weave before I wrote Literate. I simply found that it did not let me do the things I wanted. Here are some advantages with Literate (essentially the main reasons why I wrote the package in the first place):
- Literate makes it easier for the user to hook into the generation. This means that you are not locked by the syntax/features that Literate offers, you can do your own custom source transformations. I think this is important, since all packages are different, and all users have different things they want to do, and all these features can not be in the package. Real life example: https://github.com/KristofferC/JuAFEM.jl/blob/13a51cc4c3d11da64fb34ed1ea96e35739a42f6b/docs/generate.jl#L11-L13 where the custom
postprocess
function dumps the result of theLiterate.script
output into the markdown file, to include the source in the last section: http://kristofferc.github.io/JuAFEM.jl/latest/examples/generated/heat_equation.html#heat_equation-plain-program-1 - Filtering of lines: Literate filters some lines based on the output, see https://fredrikekre.github.io/Literate.jl/latest/fileformat.html#Filtering-Lines-1. This is very convenient and you can for example add things like https://github.com/KristofferC/JuAFEM.jl/blob/13a51cc4c3d11da64fb34ed1ea96e35739a42f6b/docs/src/examples/heat_equation.jl#L5-L7 which you probably don’t want in the notebook output.
- Better integration with Documenter.jl: You can use Documenter-style
@ref
and@id
without this leaking out to the notebook/script outputs. - Literate is more lightweight since it does not contain all the machinery to generate html/pdf etc.