Thanks to the work of @dfabulich iplayif.com now offers a sitegen service, allowing you to upload your storyfile (Adrift 4, Glulx, Hugo, TADS 2/3, Z-Code) and get a tailored single-file version of Parchment. Try it out here:
I’ll be making some additional changes behind the scenes over the coming weeks, but nothing that will be too noticeable, and it is ready to use right now. Single-file Parchment files can be downloaded and played offline, or can be uploaded to itch.io and other services.
This converter will be especially useful for making games playable on Itch.io. If you only upload a Zcode/Glulx story file to Itch, players have to download your file and use an interpreter to play it. If you also upload an HTML file, Itch can include a “Run Game” button, allowing your players to play your game right there in a web browser, or even download the HTML file and play it offline without a separate interpreter.
You don’t even have to upload the file by hand! https://iplayif.com/api/sitegen has a REST API, allowing you to convert IF game files to HTML with a simple HTTP request. For example, you can run this
curl command to convert the
LostPig.z8 story file to HTML:
curl -o output.html -F "story_file=@LostPig.z8" https://iplayif.com/api/sitegen
You may find
curl easier to work with than
ifsitegen.py, a Python 3 script that does something similar.
ifsitegen.py requires you to install Inform 7, it only works on Zcode and Glulx story files, and it may use an old version of Parchment.
The Parchment HTML Converter at https://iplayif.com/api/sitegen has no dependencies, it supports more files, and it always uses the very latest version of Parchment.
That’s super rad. Thanks for the fine effort!
(throws out all the work-in-progress I had tinkered with to accomplish the same thing)
For an Inform 7 game, would the result of this be basically the same as what happens when you “Release along with an interpreter,” or is this something different?
Basically the same, except that all the resources are embedded into one file rather than having an interpreter folder. And it has the advantage that you don’t need to do anything to support images.
Is the main advantage of this that it makes it more user-friendly (for someone who’s not playing online)? Or maybe some places like itch.io only accept a single file?
Does the author have any way to edit the CSS?
Oh–does Parchment usually not support images for online play?
Anyway, congrats! And please consider adding it to ifwiki! Form:Software - IFWiki
Parchment does, but Inform 7 doesn’t incorporate the images into the Parchment files appropriately, so you need to run an additional script after compiling to make them work.
This is fantastic. My experiences with “release along with” in i7 were, well, there was some friction there (I had in-game images).
It honors system light/dark preference, too! Thanks for this.
e: even though I put a lot of work into my page & css for RTE, I’ll switch to this for release 4. One less thing to maintain.
It is basically essential for the non-Glulx/ZCode terps because they use WASM files, which can’t be loaded from a file: URL. The WASM files get base64 encoded so are 33% bigger, but the increase from encoding disappears once they’re zipped.
And single file is just generally simpler. Much easier to just have a single file to give someone or upload somewhere, than to deal with a folder of files, to make sure they’re in the right place, have the right file types set, etc.
You can edit the HTML to add any CSS you like. With the usual caveats that changing colours is easy and safe, but changing the measurements of anything risks breaking things (I’ve spent a long time carefully calibrating the AsyncGlk CSS.)
Quite a game changer for TADS. Thank you.
To be clear, the original
ifsitegen.py was more a proof of concept than anything else. Leveraging the idea into a full service is perfect.
Makes only one page? That’s so cool!
This is cool. I’ll definitely check it out. I can produce ulx files but have not yet looked into wrapping it up as something easy to distribute and play without installing additional software. This seems like just the ticket!
So If my Inform 7 game has images they will be included in .glorb file I upload (sorry, not extremely familiar with the file format)?
Could you provide any more details about the additional script that has to be run along with any releavant instructions?
Yes Inform puts all the images in the gblorb.
This tool is awesome and superconvenient because I wasn´t able to update Parchment on my own, but it seems my html file doesn´t work with Chrome.
What happens? Any errors? Does the storyfile work in regular Parchment?