Note On This Period Of Dormancy

In the middle of adding in files for the Lc0 Artemis directory that I had started, I switched projects back to Bookstacks. This is the eBook site that I started in 2002 and which has always gotten an average of two hundred people wandering in per day.

I’ve always wished to automate the whole process, but never could. The way I had always pictured it is now how it finally is, with the help of ChatGPT, and tons of drafts of PHP and Python code. This is the fourth day in a row that I’ve been working on it. So I will get back to Chess Nerd, but in the meantime, I’m getting some work done that I’ve always needed to.

For what it’s worth, the process is this:

  1. A Python script prompts me on the command line to give it an author name. The script then downloads all the English language books by that author from Project Gutenberg, renaming them consistently according to the API data, and then cleans the files by grabbing the book content from the DOM and then reassembling the books with a consistent h1, h2, h3 heading scheme.
  2. I take a cleaned book and polish it up, making sure it’s entirely consistent. Then another Python script splits the book into separate HTML files, one per chapter — followed by another one to fix the mistakes of the one before it. 🙂
  3. I use two more Python scripts to automatically generate an EPUB and PDF version. Then I upload it all to the server.
  4. The single medium-length PHP file that runs the entire site then looks at the server on loading, and whatever it sees it displays in lists, navigation, and a viewer that shows you the books one chapter at a time, with a dropdown menu that lists links to the other chapters, and pagination links for previous, next, and a list of books.

It should be noted that there is intentionally no attribution given to Project Gutenberg. This is from what I read in their boilerplate whenever I actually read it, about twenty years ago. It said that if you use the Project Gutenberg name at all, you have to insert the boilerplate at the beginning and end of every book. But if you don’t want to do that, then you can’t use the Project Gutenberg name at all.

Leave a Reply

Your email address will not be published. Required fields are marked *