Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 1, 1.1 "Some Simple Examples" is blank #9

Open
abevoelker opened this issue Apr 20, 2020 · 10 comments
Open

Chapter 1, 1.1 "Some Simple Examples" is blank #9

abevoelker opened this issue Apr 20, 2020 · 10 comments

Comments

@abevoelker
Copy link

If you navigate to the Chapter 1 page on lpn.swi-prolog.org, then click on 1.1 Some Simple Examples, the page is blank.

If you visit the same link on the learnprolognow.org version of "Learn Prolog Now!" without SWISH it has content: http://www.learnprolognow.org/lpnpage.php?pagetype=html&pageid=lpn-htmlse1

@mukhinid
Copy link

mukhinid commented Jun 1, 2021

It is still empty.

@GregDavidson
Copy link

Alas, it is still blank. No LPN with SWISH?

@JanWielemaker
Copy link
Contributor

Well, it is there mostly. LPN on swish is implemented as a proxy service. Analyzing and properly rewriting the rather dirty HTML that comes from the LPN pipeline is a bit of a challenge though. One day someone should reconsider the whole pipeline and -for example- move it to the pipeline used by Simply Logical

@marnen
Copy link

marnen commented Jan 24, 2023

@JanWielemaker Is that the issue, though? I believe I remember the SWISH version of Learn Prolog Now! working beautifully last time I tried to work with it, around 2015. I thought I'd give it another try, and unfortunately the wonderful interactive textbook that I remember seems to be no more—even though there are links to it all over the SWISH website. (It is in fact blank, not "there mostly".)

If I hadn't had the experience in 2015, and were coming to it now as my first impression of Prolog, I might well give up before I'd even started, because the major tutorial (showcasing both Prolog and SWISH) doesn't even work.

Can I help fix this somehow?

@marnen
Copy link

marnen commented Jan 24, 2023

...or could the enhancements from the Chrome extension be incorporated into whatever builds the site?

@JanWielemaker
Copy link
Contributor

After opening some pages I think the site still works as it always has. This issue points a a specific page that goes wrong and probably always has gone wrong. I suspect the proxy goes wrong on this page. You find the proxy code in https://github.com/LearnPrologNow/lpn-swish-proxy. You can run it locally and figure out what goes wrong on this page. I'm happy to handle PRs on the proxy and update the server.

To get a really good interactive LPN you have to start with the LPN source material and add annotations that gives the proxy more information about how the SWISH instances should be created from the code and query snippets. All the material is on this github organization.

@marnen
Copy link

marnen commented Jan 24, 2023

I’m fairly sure I remember that page not going wrong. I’ll poke at the code and see if there’s an obvious reason that that should happen, and if I can fix it.

@marnen
Copy link

marnen commented Jan 24, 2023

Unfortunately the conversion code is in Prolog, which I don’t know very well yet, which is why I wanted to work through LPN…but I’ll see if I can make sense of it.

But I had a general thought: perhaps if the converter can’t make sense of the HTML, it should return it unchanged instead of deleting it? The original would be better than nothing.

@JanWielemaker
Copy link
Contributor

Of course the conversion is in Prolog. What else? 😄 Actually it makes more sense than you may think because we have to figure out what is in the code boxes: a valid Prolog program? Queries? Snippets that are themselves not valid Prolog code? Could one code block define the predicates used in another, etc. Prolog's reflexive features come handy here.

But I had a general thought: perhaps if the converter can’t make sense of the HTML, it should return it unchanged instead of deleting it? The original would be better than nothing.

The HTML parser is pretty flexible in tolerating invalid HTML. I have no clue what happens, only a bit of debugging will tell. That is indeed a bit challenging for a beginner. You'll learn a lot though 😄

@marnen
Copy link

marnen commented Jan 24, 2023

I’m not saying that the conversion shouldn’t be in Prolog, but rather that since I need the introductory textbook, there may be a circular dependency. :) Maybe I’ll try Simply Logical and come back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants