tweecode / twine

UI for creating hypertext stories
http://twinery.org
656 stars 97 forks source link

Allow including .js files? #163

Open tornewuff opened 10 years ago

tornewuff commented 10 years ago

It'd be really nice if StoryIncludes could reference a .js file and include it either as a <script> tag or a passage tagged with 'script' - this would make it much easier to write/build JS code externally without having to wrap it up as twee (which confuses a lot of JS tools).

greyelf commented 10 years ago

It might make more sense if the contents of the referenced js file was embedded within the head section of the html file, similar to what is currently done with the engine.js, jquery.js, and modernizr.js files.

tornewuff commented 10 years ago

Yeah, that's what I meant by a <script> tag, though if it was done that way, would the included JS be able to access the header's variables? e.g. to define macros? Those aren't necessarily global...