Closed ssasso closed 2 months ago
I'm guessing you'd like to have reusable topology. Would components do what you'd like to do?
https://netlab.tools/components/
There's also link groups: https://netlab.tools/links/#link-groups but that would require _include within a list, and I don't think we do that.
Other than that, I have no problem if we structure links as a dictionary of lists, and then use the dictionary keys to name the links while flattening the data structure very early in the transformation process.
Will look at the compontents, thanks for pointing that out! I always forget all the capabilities we have ;)
Will let you know
Hey @ssasso, could you get what you needed with components, or should we go and implement this one?
Not able with components. I started trying to develop a plugin for doing that without touching the core code, but gave up for lack of time at the moment :(
If I am not wrong, currently the top-level-attribute
links
is (the only one?) defined as a list.That means it is not possible to use the construct
_include
in it, thus not allowing code reuse.My proposal is to accept as
links
value both dict and list.This will allow to have sth like:
which is converted into sth like:
which, at the end, behaves like:
If we do not want to modify the "core code", I guess this can be performed as pre-transformation step in a dedicated plugin?