Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.
/ yarn Public archive

Generate a JSON representation of Twine 2 flows

Notifications You must be signed in to change notification settings

yerdle/yarn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yarn

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"
        }
      ]
    }
  }
}

Usage

From CLI

node index.js twine.html [--drop-text] [--normalize] [--lower-intents] > export.json

From code

const yarn = require('yarn')

const twineHtml = ... // Load the Twine HTML somehow
const json = yarn.convert(twineHtml)

License

MIT

About

Generate a JSON representation of Twine 2 flows

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •