Interactive Prolog Book Example


Bugs and feature requests regarding the sphinx-prolog package and its functionality should be reported as issues in the simply-logical/sphinx-prolog GitHub repository. Typographical and other presentation errors related to this template and its content should be reported as issues in the simply-logical/prolog-book-template GitHub repository.


In addition to Prolog, the sphinx-prolog package can be used to build documents with interactive cplint code blocks. More information can be found at


This online book describes the process of building online interactive Prolog materials using SWI Prolog and SWISH. It is hosted on GitHub Pages, and built with Jupyter Book and our custom sphinx-prolog extension. The source of this book can be found in the simply-logical/prolog-book-template GitHub repository, which can also serve as a template and a starting point for building your own book.


A great example of a Prolog book built with the aforementioned technology stack is our online edition of the Simply Logical: Intelligent Reasoning by Example book by Peter Flach. You can find it here:

Building the Book

To build this book you need two Python packages: jupyter-book and sphinx-prolog. You can either install them manually

pip install "jupyter-book>=0.10.0"
pip install "sphinx-prolog>=0.5"

or by using our requirements.txt file, i.e., pip install -r requirements.txt. Then, the book can be built with jb build ..


For more details about installing necessary dependencies and building this book see the file included in the GitHub repository that holds the source of this book.