delph-in / docs

DELPH-IN Documentation

Home Page:https://delph-in.github.io/docs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images not displaying correctly on ERG Semantics pages

emilymbender opened this issue · comments

Not sure if this is a new issue or not, but the the .png file linked here is showing up as a broken link:
https://delph-in.github.io/docs/erg/ErgSemantics/

Even though it displays correctly here:
https://github.com/delph-in/docs/wiki/ErgSemantics

Yes, this is a bug that I have to fix, but I haven't found a good workaround yet. The reason for the problem is described in this stack overflow post. I'll queue that up to find some workaround when I get back from vacation in 1.5 weeks...

Thanks, Eric!

Turns out they aren't broken in Safari, I guess Safari doesn't mind mixing an https page with an http image.

So, I think we have two options here:

  1. (Best option) If we can get the SVN to support https for these images (which seems kind of required in the modern age), I can swap these links to be https links and then they will work. @emilymbender, @arademaker, @olzama: does any of you know how to get this done??
  2. I can download all of these images, include them in the docs repository and repoint the links at the copies. A bunch of work that seems unnecessary since SVN should support https in the first place.

For example, here is one of the image links:

http://svn.delph-in.net/erg/tags/1214/www/esd/the-garden-dog-tried-not-to-bark.png

If you try accessing it directly via http it works, but via https you'll see that it fails. That's what we need to fix for #1.

@EricZinda

Check out the updated page https://github.com/delph-in/docs/wiki/ErgSemantics; it turns out that this image, in particular, is in the ERG repository, https://github.com/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png.

So do not copy it to the docs repository.

i am afraid enabling HTTPS for the DELPH-IN subversion server is not a short-term option.

the point of including these images with the ERG source repository was to version the analysis jointly with the grammar.

the images are auto-generated from actual ERG outputs (and manually colored). they should in my view not be disassociated from the ERG source repository and releases.

I understand that. So the suggestion to keep linking to the image in the erg repository, already migrated (in process of migration?) to GitHub.

@EricZinda

Check out the updated page https://github.com/delph-in/docs/wiki/ErgSemantics; it turns out that this image, in particular, is in the ERG repository, https://github.com/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png.

So do not copy it to the docs repository.

This is great. The update you did almost worked for the docs site. The tricky part is you used a link for the image that was the whole page in the repository that you could browse to to get the image (https://github.com/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png). That worked for the wiki because github must do magic to the url before it renders it. I had to change it to include raw=true at the end to not include all the surrounding stuff and make it work in the docs site (i.e. https://github.com/delph-in/erg/blob/main/www/esd/the-garden-dog-tried-not-to-bark.png?raw=true).

With that change, the image now shows up in the docs site correctly: https://delph-in.github.io/docs/erg/ErgSemantics/

I'll see if I can make the doc builder code check for that and add it automatically since I think it will be a common "mistake". Once I get this fix in, I'll go update the pages to point to the github images

I have a tiny preference to make this change in the url in the code that produce the website. Keeping the link in the wiki without the raw parameter. Is it possible?

So instead of just checking, always add it during the building. But this is what you are investigating now, right?

Yes, that's my plan. Actually, the link in the wiki can be with or without the "raw=true" and the code that generates the site will fix it (or not) as needed

OK, the issue is now fixed by adding some code to the documentation script and making two changes to the images in those wiki pages:

  1. Change from using raw HTML in the wiki (i.e. <img src="example.png" title="Title text" alt="alt text" />") to using the markdown way of doing images (i.e. ![alt text](example.png "Title text"). This is so the documentation script can access the text since it only parses markdown.
  2. Change the link from the svn.delph-in.net site to the https://github.com/delph-in/erg/tree/main/www/esd site.

The documentation script adds raw=true to the URL automatically if it isn't there when it creates the site, but leaves the wiki page in whatever form it was. This is required so that it can be used as an image.

You can see that now https://delph-in.github.io/docs/erg/ErgSemantics/ shows "The garden dog tried not to bark" MRS correctly. As does https://delph-in.github.io/docs/erg/ErgSemantics_Essence/. I did notice that the image quality is way worse on the latter. That seems to be a true reflection of the JPEG quality of those assets, not something getting changed with rendering.

Note also that there are 109 other http://svn.* references in the wiki, but they are all just regular links (not images). So, they work just fine. It is only when a browser is asked to render https and http assets in the same page that this problem comes up.