Open hituro opened 1 year ago
which is then loaded by a compiler
A couple of points of clarification:
So any special handling of such tagged passages in a Twine 2.x compatible Story HTML file must be being done by the Author themselves programmatically, which means that an Author could use any Passage Tag to mark such passages as special.
How will an Author know:
While none of the main StoryFormats currently do anything with those passage tags (though see the feature recently suggested on Sugarcube to provide a mechanism to do such) there is a tradition within Twine development that has given special consideration to such tags, and — as you note — some compilers (TweeGo, Gordian) do specific things with those tags.
SugarCube's Twine 1 mode also treats them as special.
Nevetheless you've hit on the exact reason that I consider this a Twine UI feature, and not a StoryFormat one, the fact that those passages are mostly special outside the context of a particular StoryFormat.
As for why those tags in particular, it's only because they have had special status in the past. Other tags would be perfectly possible.
As would other approaches, such as having user-definable syntax modes on every passage, like an IDE, but that's much more of an ask than this approach.
Not sure how I feel about this idea yet. I don't have a great handle on how many people use these tags and I worry about other variations like "js", "css", "javascript", and so on. There is a localization concern that if we respected the "stylesheet" tag, then we ought to respect all the other translations of "stylesheet", and the same's true for "script".
Is your feature request related to a problem? Please describe.
Although passages tagged with
script
orstylesheet
have no special implicit meaning in Twine 2, they are nevertheless used by many people to store JS or CSS data (which is then loaded by a compiler, or by a user-script). However, text in those passages is treated as normal passage text, meaning that it gets the passage editor/highlighter when present, and no highlighter at all when not present.Describe the solution you'd like.
It would be great if those passages were highlighted using the existing JS/CSS highlighting modes.
Describe alternatives you've considered.
An alternative would be to leave this to the StoryFormat to implement in its syntax highlighter, but since many formats don't have one it would be a lot easier if the editor, which already has the appropriate modes, were to handle it.
Additional context on this suggestion.
No response
Presubmission checklist