Index is really broken in Chrome for me

First: _index.html does not exist, so if I remove it, I get a directory listing.

Second: This is what the world index looks like.

The other pages aren’t much better. :frowning:

What could be related is this is one of the reported images its going for.

image

The inform:/ probably explains it since when i visit it, it says “Chrome OS can’t open this page”. But how can I fix this? If it helps, I’m using Crostini in ChromeOS.

The Index files aren’t really meant to be used outside the IDE. But you can fix that:

Look to where you installed Inform, probably under /usr/local, unless you manually specified a prefix with install-inform7.sh. There will be a share/inform7/Documentation directory. Note it.

Now go to your project’s Index directory and do this, filling in the directory above as appropriate. (There are really 3 /'s after ‘file:’ and include the trailing / after Documentation.)

perl -pi.bkp -e 's{inform:/}{file:///usr/local/share/inform7/Documentation/}g' *.html

If it works to your satisfaction, you can delete the .bkp files and just say -pi without the .bkp in the future.

This might fail if there’s a space in your directory name; I’ll look more eventually.

(Some time soon, I hope, I’ll release my Inform CLI’s Helper stuff so we don’t all have to keep re-inventing this.)

2 Likes

Heh, guess the cheesy perl edition doesn’t count as an ide :madness:

but yeah, I’ll try that in a few minutes. Thanks for your comment!

And this’ll fix the references to the source file:

perl -pi -e 's{source:story.ni}{file:../Source/story.ni}g' *.html

and Welcome.html is basically what you want as index.html. But renaming it or linking won’t help because filling in index.html (or whatever) when there isn’t one is something web servers (may) do and there’s no web server involved when you’re looking at local files with file:// URIs.

I actually hadn’t done this before, but due to recent spelunking I understood how one would do it. Regexp modification of HTML is error-prone in general and usually to be avoided, but I couldn’t have whipped up a proper DOM-parsing solution in the amount of time I could allot. :grinning:

Oh yeah, and the documentation links will be broken 'cause the CLI package includes the html files made for Inform’s website and the IDE has a different build. Easiest way to fix that would be to crack open one of the IDE packages and copy the html files from its Documentation directory to your share/inform7/Documentation directory. (And these files will have their own inform: references in need of changing…)

Ok, your solution helped, but now there’s this.

Please cut and paste text (with a preformatted tag) rather than doing screenshots of text output.

if you do an ls on /usr/local/share/inform7/Documentation I would expect you to see directories called map_icons and bg_images. And if you don’t see them (or don’t see that Documentation directory at all), my guess would be that you installed Inform somewhere else and should have used something other than /usr/local/share/inform7/Documentation in the perl regexp.

Those folders do exist …

$ ls /usr/local/share/inform7/Documentation/bg_images
bl_corner_e0e0e0.gif  br_corner_e0e0e0.gif  indexcard.png         tl_corner_e8e0c0.gif  tr_corner_e8e0c0.gif
bl_corner_e8e0c0.gif  br_corner_e8e0c0.gif  tl_corner_e0e0e0.gif  tr_corner_e0e0e0.gif

$ ls /usr/local/share/inform7/Documentation/map_icons
blank_ew.png               in_arrow_door.png         long_swne.png              ns_spacer.png               s_arrow.png                sw_arrow.png
blank_ns.png               in_arrow.png              n_arrow_door_blocked.png   nw_arrow_corner_door.png    s_dot.png                  sw_dot.png
blank_square.png           long_ew_ns_nwse.png       n_arrow_door_meet.png      nw_arrow_door_blocked.png   se_arrow_corner_door.png   u_arrow_door_blocked.png
d_arrow_door_blocked.png   long_ew_ns.png            n_arrow_door.png           nw_arrow_door_meet.png      se_arrow_door_blocked.png  u_arrow_door.png
d_arrow_door.png           long_ew_ns_swne_nwse.png  n_arrow_fading.png         nw_arrow_door.png           se_arrow_door_meet.png     u_arrow.png
d_arrow.png                long_ew_ns_swne.png       n_arrow.png                nw_arrow_dot.png            se_arrow_door.png          w_arrow_door_blocked.png
dislocation.png            long_ew_nwse.png          n_dot.png                  nw_arrow_fading.png         se_arrow_dot.png           w_arrow_door_meet.png
e_arrow_door_blocked.png   long_ew.png               ne_arrow_corner_door.png   nw_arrow.png                se_arrow_fading.png        w_arrow_door.png
e_arrow_door_meet.png      long_ew_swne_nwse.png     ne_arrow_door_blocked.png  nw_dot.png                  se_arrow.png               w_arrow_fading.png
e_arrow_door.png           long_ew_swne.png          ne_arrow_door_meet.png     out_arrow_door_blocked.png  se_dot.png                 w_arrow.png
e_arrow_fading.png         long_ns_nwse.png          ne_arrow_door.png          out_arrow_door.png          sw_arrow_corner_door.png   w_dot.png
e_arrow.png                long_ns.png               ne_arrow_dot.png           out_arrow.png               sw_arrow_door_blocked.png
e_dot.png                  long_ns_swne_nwse.png     ne_arrow_fading.png        s_arrow_door_blocked.png    sw_arrow_door_meet.png
ew_spacer.png              long_ns_swne.png          ne_arrow.png               s_arrow_door_meet.png       sw_arrow_door.png
grid.png                   long_nwse.png             ne_dot.png                 s_arrow_door.png            sw_arrow_dot.png
in_arrow_door_blocked.png  long_swne_nwse.png        no_arrow.png               s_arrow_fading.png          sw_arrow_fading.png

oh, I think I’ve got it. It’s a ChromeOS thing: what you really need is the path that would let Chromium at the files within the crostini directory. I don’t have a crostini instance lying around to help further.

If you were to install Firefox within your crostini instance, what you have should work as is for that Firefox. Assuming that’s still possible; my recollection is you could do that in crouton as of several years ago.

Oh yes, I just realised - it has to go into the folder thingy which chromeos doesn’t have access to.

Now I know what to do. Thanks for your help.

If it works, I’ll put what I did here.

Yep - I realised correctly.

To give CHROME access to Crostini’s stuff, I just did this. Prerequisites: apache.

sudo ln -s /usr/local/share/inform7 /var/www/html/inform7;perl -pi.bkp -e 's{inform:/}{http://penguin.linux.test/inform7/Documentation/}g' *.html

(In ChromeOS, penguin.linux.test refers to the Crostini instance. It is subject to change. Please let me know if it does.)

Annoying part is you have to do that every time. You could solve that by alias i7="/usr/local/bin/i7;cd blabla;cd Index;perl -pi.bkp -e 's{inform:/}{http://penguin.linux.test/inform7/Documentation/}g' *.html. You could shorten that even more with a Makefile that is aliased to i7, but I digress.