Twine: HTML file to Twee source code converter

Update: this converter is now built into Twine 1.4 (in the "Import Compiled HTML file" menu item), so this page is no longer necessary.

HTML to Twee Converter

Someone on my Twitter feed reported that they'd lost the source code of a Twine game of theirs, and wanted to know if they could convert the HTML back to a usable format. So, I decided to quickly knock up a utility that could do that. Here it is - it extracts the passages from a HTML twine game and converts them to Twee source code, which Twine can import using the "Import Source Code" menu option. I hope it works for you.

AttachmentSize
Twine_HTML_Twee_Converter.html2.96 KB

Comments

Twee converter bug/s

I ran this utility yesterday on a small Twine executable. It appeared to run correctly but when I compiled the output into a new executable it did not run any macros.

I looked at the html source code and discovered that the "tags" entry was defaulting to ' tags="" ' instead of the correct ' tags="script" '.

I also tried it with a very large Twine executable. It eventually produced output which I was able to import into Twine, but it would not compile.
Twine output this error message:
"An error occurred while building your story ('ascii' codec can't decode byte 0x95 in position 302985: ordinal not in range(128))."

A pity, as it looks like a very useful tool.