lazerwalker / twison

A Twine 2 story format that provides JSON export
MIT License
148 stars 34 forks source link

error trying to add the storyFormat #9

Closed dcsan closed 8 years ago

dcsan commented 8 years ago

image

I also got this error

The story format “SugarCube” could not be loaded (storyFormat was not called).

which is pointing to another format - SugarCube - which in fact does seem to be loaded for me.

but it seems you are calling that method: http://github.com/lazerwalker/twison/raw/master/dist/format.js

window.storyFormat({
  "name": "Twison",
  "version": "0.0.1",
  "author": "Mike Lazer-Walker",
  "description": "Export your Twine 2 story as a JSON document",
  "proofing": false,
  "source": "<html>\r\n\t<head>\r\n\t\t .... ......."
});
dcsan commented 8 years ago

I was able to import this format http://cau.li/TwineJson/format.js

from https://github.com/cauli/TwineJson

so at least the format importer is working on twinery/web

dcsan commented 8 years ago

FWIW it seems current version of twine has broken the format outputting anyway.

https://github.com/cauli/TwineJson#warning-it-looks-like-using-twinejson-with-the-current-version-of-twine-2-is-not-working-at-the-moment

lazerwalker commented 8 years ago

I'm able to reproduce your issue in Chrome, but not Firefox or Safari. What browser are you using?

dcsan commented 8 years ago

I was using chrome, but you're right it works fine in Safari.

another thread here: https://github.com/cauli/TwineJson/issues/4#issuecomment-165648355 these two projects are related?

lazerwalker commented 8 years ago

They're not explicitly related; I basically couldn't get TwineJson to work, and ended up writing this as a result of that (see https://github.com/cauli/TwineJson/issues/2). Similar techniques and approaches, different codebases.

lazerwalker commented 8 years ago

@dcsan Think I've figured this out.

When trying to load external JS, Chrome (unlike Safari and Firefox) by default enforces MIME type checking to only allow execution of scripts that are of an executable type. Since GitHub doesn't expect you to use their raw file URLs as a CDN (slash probably actively wants to discourage it), they send all files served that way as "text/plain", which then sets off Chrome's security checks. Hosting this file elsewhere seems to clean up the issue for me.

tl;dr: try adding http://lazerwalker.com/twison/format.js as your story format instead.

Let me know if that works?

dcsan commented 8 years ago

yep, that works!

so the main difference of your project vs cauli/TwineJson - seems yours is a bit more robust, solving cyclic dependencies etc?

lazerwalker commented 8 years ago

I'd characterize Twison as more focused. It's focused on providing first and foremost a basic dump of Twine's internal XML format into JSON, and then augmenting it with what data we can safely extract without introducing complexity like cyclic dependencies (e.g. parsing links).

On top of that, I'd say there's an emphasis on documentation, stability, and ease of development. Things like up-to-date documentation on the expected output format, unit tests connected to a CI server, well-documented scripts to compile development versions of the script into production builds, etc.

lazerwalker commented 8 years ago

(Also, closing this issue for now, since it seems like the issue itself has been solved)