Expose hljs for external modification #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request is intended to address issue #8 that I opened recently. Apologies if this is not how you'd prefer to solve the problem, but this is the way that I'm currently using in my forked copy.
This PR adds a visible
hljs
member to thechromafi
object;chromafi
is no longer just a function, now it's an object with anhljs
member. By modifying this member, one can usechromafi
with languages other than the ones it natively supports. For instance, here's an example from my own code, using thehighlightjs-solidity
package:Now
chromafi
will be able to colorize Solidity. I then use this later:And, tada, we've used
chromafi
to colorize Solidity despite it not being natively supported! And this could just as well be used with any number of other languages that are not part of thehljs
base package but have had external highlightjs language definitions written for them.Again, if you'd prefer to solve this some other way, I understand, but I thought I should at least PR my own solution to this problem. Thank you!