I wrote a literate Prolog utility that enables you to write Prolog code inside markdown files. The chunks are processed with SWI Prolog and any output is injected back into the text. This is especially useful for documents like tutorials or reports. The utility uses pandoc as a post processor to obtain nicely formatted pdf documents. For those familiar with the R language, this utility essentially provides the same functionality as knitr.
The utility is available on github: https://github.com/RdR1024/litpro