Knowledge-Graphs-Book / HTML-Book

Other
37 stars 6 forks source link

"et large scale" and index.html in the repo #7

Closed aidhog closed 2 years ago

aidhog commented 2 years ago

@amirouche kindly corrected a typo "et large scale" in chapters/intro.php (thanks!)

The changes hadn't show up on a pull at kgbook.org/index.html, so I edited that file it by hand for the moment.

@Antoine-Zimmermann Is there an extra process (besides git pull) to build the index.html from the chapters/*.php needed for the script to sync on the server? (I.e., a way to recompile index.html from the source files?) If so, should we delete index.html from the repo?

Antoine-Zimmermann commented 2 years ago

Currently, I generate the HTML file when I decide that the PHP script is nice and good. So, any change to the PHP files does not show up automatically in the HTML version (it shows if you go to https://kgbook.org/book.php). To generate the HTML, just go to https://kgbook.org/book.php and save the page.

Antoine-Zimmermann commented 2 years ago

I realise that the version at https://kgbook.org is far from up to date (still in the state as of 23rd Nov. 2021). Besides, the PHP is weird. @aidhog, could you pull the current version to https://kgbook.org and make sure the latest version gets pulled automatically in the future?

aidhog commented 2 years ago

@Antoine-Zimmermann I think the issues are related. I updated the version at https://kgbook.org/ a number of times, but it goes to index.html, which I was not updating from the php.

I tried the trick you mentioned of going to https://kgbook.org/book.php and saving the page to index.html (I guess like a local cache), but as you mention, the PHP acts strangely. For example, most entries in the Bibliography did not compile. Possibly this is an incompatibility between PHP versions? Here's what the server is running:

PHP 7.4.28 (cli) (built: Feb 17 2022 16:17:19) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies

A workaround for now is to copy changes to the index.html file and keep it in the repo, but I think it would be better overall if we could remove index.html from the repo and compile it fresh from the PHP each time the book is updated on the website.

Antoine-Zimmermann commented 2 years ago

@aidhog, initially, I did not want to have the HTML generated automatically in order to have a clean version in the index.html, and a working version where I can experiment things in the PHP. I think this is not really useful now. In any case, whatever the process, your website should pull the HTML version, no need to generate it yourself from the PHP. The past edits I made, I systematically regenerated the HTML.

Concerning the PHP config, I found the problem. There is a an option in php.ini called "short_open_tag" that needs to be enabled. If you can do it, it should fix all the problems. Then, if you want, you can generate the HTML from your side and be happy :)