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

1 Like

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, …).

2 Likes

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!

@tayruh Apologies, I’m coming to this thread late in the day. I would love to give your gamebook tool a spin, but the two links posted above by StJohnLimbo no longer seem to work. Would you be able to post working links for the converter? Many thanks in advance.

1 Like

Hi Sean, welcome!

Unfortunately, tayruh hasn’t been active on the forum for a while. (BTW, @tayruh, if you read this: it would be cool if you drop by again! I appreciated your projects, even though I didn’t get around to using them myself, as I mostly work with parser-based systems.)

Hopefully he can send you a version. I can also check whether I’ve got a copy somewhere that I might have downloaded back when the repository still existed.

As additional options, you could take a look at these:

Gordian Book

Twinebook

(I haven’t used either of them, so I’ve no idea how well they work.)

2 Likes

StJohnLimbo Thank you so much for taking the time to reply and provide all of your helpful links. I really apprecaite it, and I will explore these options shortly. More power to you and your generosity of spirit sir!

2 Likes

StJohnLimbo!! IT WORKS!! Gordian Book works!! Amazing. StJohnLimbo you have saved me a week’s work you absolutely legend!! If I can ever repay the favour, you need only ask. Thank you. Thank you. Thrice thank you!!

2 Likes