Literate.jl
Literate.jl copied to clipboard
Plea for *simple* example of rendering a file with markdown and LaTeX into a PDF or HTML using Documenter.jl
I am big fan of literate programing (in theory...), and for many years I used a home-spun vanilla C utility that stripped LaTeX comments out of my source files to run through pdflatex. worked great. However, its the 21st century.
However, I cannot figure out how to get Documenter.jl to create a PDF file from the psm_test.md created by Literate.jl. I really have spent two hours reading the Documenter.jl manual. Its a deep and powerful system, clearly.
Your documentation is well written, but it assumes a level of knowledge of Documenter.jl that I just don't have, and I think other newbies to Julia might not have either. I really want to use Literate.jl for new project. Thank you for your patience and your contributions to Julia.
julia> Literate.markdown("psm_test.jl")
#======================================================================
ok, Julia has multi line comments pound equals ... equals pound... cool
Literate.jl should turn this into markdown, so this should be **BOLD**
This next math equation is from the Literate.jl documentation
```math
\int_\Omega \nabla v \cdot \nabla u\ \mathrm{d}\Omega = \int_\Omega v f\ \mathrm{d}\Omega
```
what is magic incantation of Documenter.jl to turn this into a PDF?
===========================================================================#
using WAV
y,Fs,nbits,stuff = wavread("JolieHollandSacha.wav") # 16bit 44_100Hz sampling (ripped from CD)
y_int_24 = floor.(Int32,y * 2^23)
wavwrite(y_int_24,"test_WAV_dot_jl__24bit.wav",Fs=44_100,nbits=24,compression=WAVE_FORMAT_PCM)
creates this markdown (which makes sense)
```@meta
EditURL = "psm_test.jl"
```
ok, Julia has multi line comments pound equals ... equals pound... cool
Literate.jl should turn this into markdown, so this should be **BOLD**
This next math equation is from the Literate.jl documentation
```math
\int_\Omega \nabla v \cdot \nabla u\ \mathrm{d}\Omega = \int_\Omega v f\ \mathrm{d}\Omega
```
what is magic incantation of Documenter.jl to turn this into a PDF?
````@example psm_test
using WAV
y,Fs,nbits,stuff = wavread("JolieHollandSacha.wav") # 16bit 44_100Hz sampling (ripped from CD)
y_int_24 = floor.(Int32,y * 2^23)
wavwrite(y_int_24,"test_WAV_dot_jl__24bit.wav",Fs=44_100,nbits=24,compression=WAVE_FORMAT_PCM)
````
---
*This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).*
But then what is the magic incantation of Documenter.jl that renders this markdown into PDF or HTML (with Math support, of course). Thanks again.
see https://discourse.julialang.org/t/literate-jl-to-pdf-using-documenter-jl-simple-question/129109/2
@perrinmeyer I have a setup that works for me over in https://github.com/fredrikekre/Literate.jl/issues/273#issuecomment-2901852236. Does that help you? 🥨 It sounds like we have similar use cases: we're making documents, not websites.
I guess you want an all-in-one option. Personally I haven't figured out Documenter.jl yet because it seems very dense and really aimed much more at making whole websites than single documents, and I'm happy enough with my workflow that renders to PDF through Obsidian (it's a nice previewer!). When I get around to automating it more I would probably use pandoc in lieu of Documenter.jl.
@kousu - thanks, but the helpful folks of discourse figured out the magic Documenter.jl makedocs() to create a PDF from Literate.jl, so I'm a lot closer to my "one simple function" wish
https://discourse.julialang.org/t/literate-jl-to-pdf-using-documenter-jl-simple-question/129109/6