Generate a JSON representation of Twine flows
{
"screen1": {
"name": "Start",
"text": "Blah blah blah",
"intents": {
"Yes!": "screen2",
"No": "screen3"
}
},
"screen2": {
"name": "Introduction",
"text": "Bloh bloh bloh",
"intents": {
"Maybe": "screen4",
"No": "screen3"
}
},
"screen3": {
"text": "Bluh bluh bluh",
"name": "Sorry",
"actions" : [
{
"actionSequenceType": "pre",
"actionType" : "saveItem",
"values" : ["item_name", "photos"]
},
{
"actionSequenceType": "post",
"actionType" : "notify"
}
]
}
}
}
node index.js twine.html [--drop-text] [--normalize] [--lower-intents] > export.json
const yarn = require('yarn')
const twineHtml = ... // Load the Twine HTML somehow
const json = yarn.convert(twineHtml)
MIT