-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Welovesvg #37
Welovesvg #37
Conversation
This reverts commit 4edb1c8.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure the change in Compiler.RewriteLinkNode at 928, under the comment "For macro links, attributes become data attributes", is the cleanest way to handle this. Instead, I'd suggest we just take the dataAttrs
argument as-is, and prepend data-
back where RewriteLinkNode
is being called (or not, as in the case of RewriteExternalLinkNode
). The current test if(!hasExternalUrl)
made me do a double-take because it doesn't appear here to have anything at all to do with data attributes; this only made sense after I dug around and found out that RewriteExternalLinkNode
is building a dataAttrs
array that contains href
and target
.
Separately, I think the externalLinkHTML
and backButtonHTML
settings could be wrapped in an object for organization, so we get something like linkTags.external
, linkTags.inline
(another case I've thought of showing an icon; see below), and linkTags.back
.
The motivation for tagging inline links is the same as the motivation for tagging external ones: neither link type navigates to a new section, which means that (for most cases) neither link type is a "meaningful" action in terms of game advancement; they're either "let's take a detour to this other website in parallel" or "let's get a little more information about this part of the current section".
Is the FontAwesome-enabled tag for externalLinkHTML
what it is because of a requirement of FontAwesome? It's a pretty awkward-looking tag. :P
I like your logic because of all the times I've been playing a Twine game and wanted to make sure to click on all the inline links first. To take it another step further, we could also add an option to tag section links. As for your last question, yup. |
Requested changes (+ function and section link tags) are now implemented, plus an example to demonstrate them without cluttering up the basic examples with a million icons. |
One more thing I'd like to change: I can imagine use-cases where it would be better to have a link tag prepended to the text instead. For example, if someone is making a JRPG action menu and the links are function links, it would look better to have the tag in front. I can implement a switch pretty quickly I think. |
Addresses issue #9
Changes proposed by this pull request:
Compiler.ts
modified to rewrite external links, appending HTML defined infractive.json
fractive.json
Notes:
fractive.json
isn't a good place to be defining raw HTML stuff. Or maybe it is, but those things should be specially named aliases.fractive.json
to also define raw HTML for a back button (Back Button #36). If this approach is accepted I can carry on implementing that.@invicticide to review