I’m with you. I was searching for a solution to that very problem not too long ago. Pluto is the best for code and visualizations in the same document as long as what you want to show can be done in a single script using registered packages. When I wanted to have math visualizations in my own unregistered package, I had to turn to Weave and separate PDFs. I made this package so ] test
will build the documentation PDFs from the source code with Weave. (Weave has an option to use regular .jl files with specially-formatted comments.) Let me know if you find another way!