-
Notifications
You must be signed in to change notification settings - Fork 75
Support "effects" in AO structured headers #362
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
Conversation
b5387cd to
653cb12
Compare
|
Forgot to add that there is preliminary styling for |
|
"uc" seems rather cryptic. Does the effect name have to be so short?
In an invocation, you mean? |
Nope, I'm open to any name here. Originally it was 'can-call-user-code' which was kind of long.
Yes, exactly. |
|
Also to be clear, I'm not wedded to the way "UC" is styled right now, it's just what I was using to test. |
|
Looks reasonable at a glance, though we should sort out whether we're going to take generic a generic "effects" attribute or to have a concrete list. Also needs tests/docs, which I can get to at some point if @syg doesn't. |
9cf3ce1 to
6164fa9
Compare
This PR adds support for the
effects<dt>key to the AO structured header. The corresponding<dd>is a comma-separated list of strings.The list of effects are propagated to all clauses that have an Xref to (i.e. users of) the AO with the effect, transitively. Some effects are runtime-only and do not propagate to static SDOs. Currently, only
user-code(i.e. "can call user code") is included in that list.During autolinking, linked AOs and SDOs that are invocations (current supported styles are
AO()andSDO of) with effects get the effect names as class names prefixed withe-on the<a>tag. For example, if a link to an AO has theuser-code"can call user code" effect, links to it would include the classe-user-codein applicable contexts. Foruser-code, since that only applies at runtime, that class doesn't appear in links within static SDO clauses.Since the propagation of effects is conservative, there may be false positives. The list of effects may be suppressed with the
<emu-meta>tag around the AO invocation:<emu-meta suppress-effects="user-code">AOName()</emu-meta>.