Skip to content
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

Allow Nested Element/Anchor Access #382

Closed
johannes-wolf opened this issue Dec 9, 2023 · 2 comments · Fixed by #523
Closed

Allow Nested Element/Anchor Access #382

johannes-wolf opened this issue Dec 9, 2023 · 2 comments · Fixed by #523
Labels
Milestone

Comments

@johannes-wolf
Copy link
Member

Allow accessing nested element anchors by registering elements insides groups via the element path.

Proposed syntax is to separate element names by slashes (like file-system paths):

group(name: "parent", {
  circle((), name: "child")
})

content("parent/child.center", [Example])
@fenjalien
Copy link
Member

Is the slash actually necessary? With anchors now being functions, the group parent would receive "child.center" which would be identified as a child's anchor. If a default anchor is given ("child"), they could just override/take precedence over the group's anchors?

@johannes-wolf
Copy link
Member Author

johannes-wolf commented Dec 10, 2023

Without a slash, how should we know if "elem.abc" is "elem.abc" or "elem.abc.default"? By probing if the anchor "abc" returns something and falling back to "default" otherwise?

@johannes-wolf johannes-wolf linked a pull request Dec 10, 2023 that will close this issue
@fenjalien fenjalien added this to the 0.3.0 milestone Jan 17, 2024
johannes-wolf added a commit that referenced this issue Mar 16, 2024
Supersedes #389. Closes #382 and #466 

Co-authored-by: Johannes Wolf <519002+johannes-wolf@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants