Just a suggestion Stefan: In asciidoc there is an include directive. So instead of writing the nim source code in the book, write them in a subfolder and include them in the document. This will enable to include the result in the same way, so that the examples can be run and refreshed before generating the final book.
I've seen this approach in a book "Managing Projects with GNU Make" by Robert Mecklemburg, published by O'Reilly (ISBN 978-0-596-00610-5 if you are interested by this book). It is possible to use the same idea as in this book and build a Makefile that compile the examples, run the examples and save their output to .result files and then generate the final .html, .epub, .pdf book format.
Jerome
Just a suggestion Stefan: In asciidoc there is an include directive. So instead of writing the nim source code in the book, write them in a subfolder and include them in the document. This will enable to include the result in the same way, so that the examples can be run and refreshed before generating the final book.
I've seen this approach in a book "Managing Projects with GNU Make" by Robert Mecklemburg, published by O'Reilly (ISBN 978-0-596-00610-5 if you are interested by this book). It is possible to use the same idea as in this book and build a Makefile that compile the examples, run the examples and save their output to .result files and then generate the final .html, .epub, .pdf book format.
Jerome