Extracting text from twine 2 to make into paper gamebook

Hi All

First post so apologies if I haven’t worked out this forum yet or if this has been answered or is in the faqs etc.

I have a short “gamebook” written in twine 2. I know about the “view proofing copy” option but is there any other way to easily export the text (and links) into word or google docs etc? Ideally somehow keeping the links “live” ie making them into hyperlinks within the word or google document.

Has some clever cider written a script or something to do it?

Just thought I’d check before rolling up my sleeves to manually reformat etc

Thanks
N

Hi, and welcome to the forum!

@tayruh wrote a gamebook tool (Thread, Github) which can convert from Twine (and other formats) to Markdown and Epub. I haven’t had an occasion to try it out yet, but it looks really neat!

Once you’ve got a markdown file, you could use the excellent pandoc to convert it into a variety of other formats (PDF with working links, Word, LibreOffice, …).

1 Like

If I may say, the best reason to use my converter instead of just reformatting by hand is that I wrote it specifically with gamebooks in mind. Namely you can mark sections of your book to shuffle around and it’ll automatically correctly the titles and links to those pages so nothing breaks or looks awkward. You can also name the passages whatever you want while writing and it’ll assign the passages numbered section names instead.

To use both of these features, you’ll have to convert to epub since it’s not supported in the markdown output. Pandoc supports epub as input, so you can convert from that to Word and the other formats you wanted.

To do this, it’d probably be easiest to use my converter to convert it to markdown first (since you probably wouldn’t know which order Twine assigned the passages in), then go into the markdown and add the settings, and then run the adjusted markdown through the converter to get the epub.

The epub format is actually just a bunch of zipped up files with the pages themselves being xhtml files. By default my converter puts every passage on a new page, but it also lets you collect blocks of passages into a single page. If you want to skip the epub compressing part, you can add <!-- epub:collection start --> to your first passage and it’ll combine all passages of your book into a single xhtml file that you can pass right to pandoc.

Anyway, if you choose to use the converter, I hope it works out for you. Let me know if you have any questions.

1 Like

Thanks Tayruh I will give it a try. Your solution sounds exactly like what I was looking for. Thanks!

Thanks for the pointer StJohnLimbo!