Twine HTML-to-text conversion? (for proofreading Twine works)

When playing IFComp entries, I noticed a typo in one I really enjoyed but didn’t want to disrupt the bigger picture.

Once I was done, I was able to look at the index.html file provided and use a bunch of regexes in notepad to cut away if statements, and I found what I was looking for.

But my question is: is there a utility to do this a lot quicker?

I really know nothing about twine–not even if you can put HTML into a Twine IDE and then extract it.

So this feels like a super-basic question, but I’d love to know about this so I can provide fellow IFComp authors who want it (and, in the future, authors looking for testers) with the small tweaks (typo/style/otherwise) that get overlooked in big-picture development.

I’m okay with pulling the index.html source and running a bunch of regexes on it in Notepad++ or Python, but my technical knowledge has a ceiling. So I’m wondering if there’s somehing more surgical that keeps stuff a big-picture test might zap or zaps what the big-picture test might keep.

Thanks!

1 Like

Hmm…I’m not sure if this is what you’re looking for, but you can import the HTML into Twine, and then there are “proofing” formats that let you see the text of all the passages (I think it’s currently under Build > Proof). That won’t cut out any of the Twine code (if statements and formatting and the like), but it’ll leave out most of the HTML boilerplate and let you see just the source text.

Unfortunately the proofing formats seem to be designed in such a way that if you save them out as text, you lose all the passage names. I do have a little JavaScript snippet somewhere that will fix it, though, let me know if you’d like me to dig that out for you…

3 Likes

Thanks very much for your help on this, Josh! I got things up and running.

Some notes for others interested in doing so: Twine 2.5.1 has a slightly different interface than the current examples populating the web. I also needed to download earlier versions of Harlowe to get things running. In particular, 3.2.3 and 3.3.1, since it is on 3.3.3 and threw an “I don’t have a Harlowe 3.3.1 file” error.

The “the story format at this address could not be retrieved” error disappeared when I tabbed away from the window and back.

The graphics below happen if you click twine, twine, and story format.

As you mentioned, clicking Build then Proof at the top menu gets rid of a lot of the javascript (basic if statements are less, which seems right, so people can see when and how they are chosen.) It may not seem to do anything, which confused me, but actually it opened up the mostly-raw text in HTML in my default browser.

my screenshot