We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently, Asciidoctor.js does not provide an API to extend a class. As a result, we need to use Opal low-level API to do so.
We could introduce a third argument on the SyntaxHighlighter.register function:
SyntaxHighlighter.register
class CustomHighlightJsAdapter { docinfo (location) { // ... } } asciidoctor.SyntaxHighlighter.register( // names ['highlight.js', 'highlightjs'], // syntax highligther CustomHighlightJsAdapter, // extends asciidoctor.SyntaxHighlighter.for('highlight.js') )
Or introduce a generic function:
class CustomHighlightJsAdapter { docinfo (location) { // ... } } asciidoctor.klass.extend(CustomHighlightJsAdapter, asciidoctor.SyntaxHighlighter.for('highlight.js')) asciidoctor.SyntaxHighlighter.register(['highlight.js', 'highlightjs'], CustomHighlightJsAdapter)
The text was updated successfully, but these errors were encountered:
The asciidoctor.klass.extend would also be useful when we register a converter using an instance.
asciidoctor.klass.extend
Sorry, something went wrong.
No branches or pull requests
Currently, Asciidoctor.js does not provide an API to extend a class. As a result, we need to use Opal low-level API to do so.
We could introduce a third argument on the
SyntaxHighlighter.register
function:Or introduce a generic function:
The text was updated successfully, but these errors were encountered: