-
-
Notifications
You must be signed in to change notification settings - Fork 141
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
Introduce an async convert #633
Conversation
This could work if we limit the scope but it has many limitations. Currently if one the following is true we will skip the include directive (ie. Asciidoctor core will resolve the file synchronously):
|
We desperately need to split out the logic that selects lines by tags and line numbers. I really don't like to see this logic repeated here (and I don't like that it is repeated in Antora either). This should be a top goal for Asciidoctor 2.0.x, and I think we should ✋ on adding it to Asciidoctor.js until that's available. |
On the other hand, I don't even think processing line numbers and tags is right here. We should be taking and caching the whole file. All we're really doing is populating a virtual file system so that those lines can be read later by the real include processor. So the filtering should be deferred until then. Isn't that correct? |
This really opens some fundamental questions about how includes are processed, and what limits there should be. This is definitely an area I want to focus on in the spec, because right now there are so many sharp edges. |
One thing is for certain in my mind. This should be marked as highly experimental because it has important consequences we still need to understand ourselves. |
👍
Sure it's the plan.
Indeed, I read the code over and over again and I'm still not sure what happens if you include a remote file and then use a relative include inside this remote file 🤔
💯 |
I will extract the new Registry APIs ( |
Superseded by #644 |
The idea is to introduce an experimental API to resolve unconditional includes (first level only). All other includes will be resolved synchronously by Asciidoctor core.
In the benchmark directory I've added a "best case scenario" with 20 unconditional includes.
Result
convert
convertAsync
Ref: #630
TODO
{
(ie. contains a variable that need to be substituted)