-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Impossible to register asciidoctor extensions #10
Comments
Thank you, @tbroyer, for reporting. I'll look into it. |
@tbroyer To me, it looks like a problem with the latest asciidoctor.js. Our existing way of registering extension works with the first call of Let's wait for their reply. |
Fwiw, from a related issue: asciidoctor/asciidoctor-kroki#421 (comment)
It looks like providing a function in the options is not that bad an idea actually. |
Yup! I saw that comment. TBH, I was hoping there might be some fix from their side. 😄 I have seen our current approach being used in other projects. Now many of those need to be changed to re-create the registry for each conversion. Having said that, I'll work on the approach, like you have suggested, using a function which gets a new Will make a new release in a couple of days. |
This can be use instead of Asciidoctor's 'extension_registry' option. 'configure_extension_registry' will create new registry for each file conversion. Fixes #10
I have published a new release, v3.1.0. |
With version 2.0.0 of the plugin, it was possible to register asciidoctor extensions using code like:
This no longer works with version 3.
I suppose it comes from upstream Asciidoctor.js changes that now requires the registry to have been created from the same asciidoctor instance; anyway, we cannot update to version 3 due to that change, and I'd suggest providing a proper and future-proof way to register asciidoctor extensions in the plugin: a callback function passed in the options that the plugin would call (if present) with an extension registry (or with the
asciidoctor.Extensions
object directly).From the user point of view, it would be used as:
And from inside the plugin, it could be along the lines of:
The text was updated successfully, but these errors were encountered: