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

Document node linking #3

Open
Radiergummi opened this issue Nov 28, 2017 · 1 comment
Open

Document node linking #3

Radiergummi opened this issue Nov 28, 2017 · 1 comment

Comments

@Radiergummi
Copy link
Owner

We'll need to come up with an easy way of creating links between arbitrary document nodes. This serves several purposes: In the case of chained build steps, we should be able to indicate that several nodes refer to the same source.
And in the actual documentation, we need to link pages and sections too.

Due to nodes implementing ID properties already, one possible way to accomplish this would be to statically link to that. IDs are supposed to change if moved between parent nodes or another node is prepended before them.
So another possibility would be to create links using references to other nodes. This has the huge advantage of uniqueness, since the reference always points to the correct node. I'm not sure on how to implement this in a clean and solid way though, this will need a lot of whiteboard work 😄

@Radiergummi
Copy link
Owner Author

As of c11dbba, links have a somewhat stable API to build the concept on. Nodes have UIDs now, so that makes cross-tree links trivial. Links can also directly point to nodes, which is the recommended way to create links (if UIDs are passed, the setter queries the root node to find the UID so that is bad performance wise).
I'm still unsure on how this will eventually carry out for module authors, since the document API lacks many convenience methods currently. We'll see how things play out once I've got time for the actual transformer implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant