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

Core: support named "transient" nodes in the eval function #40

Open
adelhult opened this issue Feb 9, 2023 · 0 comments
Open

Core: support named "transient" nodes in the eval function #40

adelhult opened this issue Feb 9, 2023 · 0 comments
Labels

Comments

@adelhult
Copy link
Collaborator

adelhult commented Feb 9, 2023

Is your feature request related to a problem? Please describe.

Note: This is mostly a reminder to deal with this issue later once the rest of the system starts to take shape. We have talked about supporting what we call named transient nodes; nodes that just exists in the document tree and get directly translated by another transform (like Row and Column produced by a table module).

When working on the first pass of the Context::transform function we realised that this can get rather complicated, at least when compared to the relatively simple approach of only allowing a single package to be responsible for a module invocations from A->B.

Imagine an example like this, what transform should we chose and from what package?

We have specifed "--target html" to the cli
and have the following transforms loaded:

        Foo -> Tex (provided by package foopack)  
        Foo -> Bar (provided by package foopluspack)
        Foo -> Html (provided by package foopluspack) <-- Easy, we choose this one. 

Imagine instead:

        Foo -> TeX  (provided by package foopack
        Foo -> Bar  (provided by package foopack)
        Foo -> Baz  (provided by package foopack)
        Bar -> Html (provided by package foopluspack)

This scenario is not as easy to solve, since we can't transform directly into the output format, should we use the Bar or Baz transform? To solve this, we would likely need to use an algorithm like Dijkstras. This is not too terrible but a lot of the code gets much simpler by just opting for the more limited approach.

We decided to use the simpler approach for now, and once we get a grip on the scheduling and have a running example go back and take a look and evaluate if the benefits of named transient nodes outweigh the cost of implementation.

Describe the solution you'd like
Support for transient nodes like Row that allow other packages to "hook" into other modules and extend them with extra output formats. Adding this later should not be a problem for the user-facing API since we likely want to support both named nodes and anonymous "compounded nodes" too.

Describe alternatives you've considered
If it ends up being to complicated or provides less value then other features, we might end up skipping this.

Additional context

@adelhult adelhult added the core label Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant