twinejs
twinejs copied to clipboard
Open story from command line
Is your feature request related to a problem? Please describe.
Hi! I understand if this might be a bit niche, and sorry if my use-case seems confusing or opaque.
I'm using the twine app as an editor for branching narrative in my own game engine and editor. Each "scene" in my game has its own twine story, which I "publish to file" and then I run the .html file through a custom content pipeline which outputs a file that the engine and editor can consume. This means there are a whole lot of story files laying around. Not great, but not terrible. But I've run into a wall (thankfully while still prototyping).
I want to be able to open a specific story from my own tooling. Today I need to open Twine, and manually find the correct story to open, or import from file, and first then I'll be able to work on the story. While what I need is to be able to start Twine so it opens a specified story automatically.
Describe the solution you'd like.
My problem would be solved by enabling a command line parameters for Twine.exe. Specifically to open a story from the command line like this, or similar:
./Twine.exe name_of_the_story.html
The result would be:
- Twine opens.
- It automatically loads the story from the filename supplied.
Describe alternatives you've considered.
I have thought about right-clicking a story file and "open with" or file association could be some sort of solution, but that isn't implemented either - it will open Twine, but not actually open the story.
I have researched if I designed the integration in a good way. I.e the tradeoffs between keeping multiple scenes segmented into one or a few stories instead of one scene per story. Changing that introduced way more issues for my use case, tooling and testing, and so on.
I have looked at if other IF tools can do this, but it doesn't look like it - and I'm enjoying working with Twine and don't want to switch.
Additional context on this suggestion.
No response
Presubmission checklist
- [ ] I am interested in working on code that would implement this feature request. (This is not required to submit a suggestion.)
- [X] I have done a search and believe that an issue does not already exist for this idea in the GitHub repository.
- [X] I have read and agree to abide by this project's Code of Conduct.
@calleleppajoki
Is the name_of_the_story.html file you referenced in the command line one of the HTML files currently located within the special folder that the Twine 2.x application uses to store its Project HTML files? Or is it just a HTML file you have stored in some other folder on your local hard-drive?
eg. are you trying to:
- open one of the Project HTML files already stored in the special folder that the Twine 2.x application stores its "projects" in?
- first import that HTML file into the folder the Twine 2.x application's stores its "projects" in, and then open that newly imported Story?
- directly open a Project HTML file located in some other folder than the one that the Twine 2.x application uses to store its "projects" in?
This is an interesting idea but I'm not sure how it would play with the story library concept. The most obvious answer to me is that opening a story on the CLI would cause it to be imported (and perhaps immediately edited), but then... what happens if there's already a story with this name in the library? I'm not sure offhand. If more people are interested in this feature, it's something I'd try to work out.