the-power-of-prolog icon indicating copy to clipboard operation
the-power-of-prolog copied to clipboard

Availability as common e-book formats

Open StrScr opened this issue 6 years ago • 7 comments

Hello. I think this resource is great, but it is a bit inconvenient that to read it offline it is necessary to run a server. Could it be possible for you to offer it in some e-book format such as PDF or EPUB? It is not necessary, but some people, like myself, find it very convenient. Thank you for your time & effort.

StrScr avatar Dec 27 '17 20:12 StrScr

Hi Oscar,

yes, I will eventually offer this as a PDF. I will send you a note as soon as it becomes available.

Thank you for your feedback! Markus

triska avatar Dec 27 '17 21:12 triska

I too would like to hear when it becomes available for offline reading as a PDF or ebook of some other kind.

kozross avatar Feb 23 '18 08:02 kozross

Thank you very much for your interest! I will prominently announce the PDF of the book once it is available.

Until then, I would like to fill a few remaining gaps and establish a more solid basis. Currently, I am still making changes almost every week, and I would also like to incorporate more feedback until then.

triska avatar Feb 25 '18 20:02 triska

Hey, any update on this? It seems development has become somewhat more stable.

NJBS avatar Jan 06 '19 20:01 NJBS

Yes, there are good news regarding this issue: Some instructions to create such a file have generously been submitted as a pull request, please see #7 for more information.

Please let me know how they work for you, and if anything is missing. If possible, please file such comments directly in #7.

triska avatar Jan 06 '19 21:01 triska

You can convert The Power of Prolog to a PDF using the command-line utility ebook-convert from Calibre. To do this, you first need to modify the top-level file prolog.html so that it contains actual relative links to the various subpages, so that ebook-convert can find them. For example, instead of

<li><a href="/prolog/introduction"><b>Introduction</b></a></li>

it needs to look like this:

<li><a href="introduction.html"><b>Introduction</b></a></li>

Once you've done that, you can convert from HTML to EPUB and then from EPUB to PDF. This worked well for me:

ebook-convert prolog.html prolog.epub --chapter-mark "none" --page-breaks-before "/" --flow-size 0  --level1-toc '//h:h1' --level2-toc '//h:h2'

ebook-convert prolog.epub prolog.pdf --chapter-mark "none" --pdf-page-margin-top 20 --pdf-page-margin-bottom 20

I also tried converting from HTML to PDF directly, but found that the generated PDF looks better if you go through EPUB as a separate step.

The generated PDF looks pretty good, but not all the embedded hyperlinks work. Again, that's because they don't appear as proper relative links in the source HTML pages. Markus, perhaps you'd like to update these links in the HTML source. (That would also make the site work better when using a Web browser to browse the site offline.)

By the way I also tried using Pandoc to perform this conversion, but I found that the result was far superior using ebook-convert.

medovina avatar Feb 23 '19 12:02 medovina

Thank you Adam for looking into this and for sharing these instructions!

I also greatly appreciate the interest from you all in in e-book version, and therefore I would like to add a general note to this discussion:

The videos will form an integral part of the book in the sense that many important features of Prolog can be most efficiently conveyed by sequences of editing operations, changes to queries, and animations of search processes. To illustrate this, I have now added a few of the videos I am currently working on, please see 3542ee45f2bd9175df547839df5991078430f8dc.

Here are a few links to some of the videos, for your enjoyment:

  • https://www.metalevel.at/prolog/videos/metapredicates
  • https://www.metalevel.at/prolog/videos/knights_and_knaves
  • https://www.metalevel.at/prolog/videos/sudoku
  • https://www.metalevel.at/prolog/videos/n_queens

The videos are always work in progress and may be replaced be newer versions at any time.

An important feature of the web-based setup is that it lets me flexibly redirect to the latest versions of these videos. Therefore, if possible, please use these stable links to refer to these videos. They will always point to the latest version.

I would like to revise some of these videos, and also add more, before I can comfortably provide an e-book version of the entire book.

Bonus videos:

  • https://www.metalevel.at/prolog/videos/logic
  • https://www.metalevel.at/prolog/videos/intro

Stay tuned!

triska avatar Mar 16 '19 09:03 triska