Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Which plugins are available for highlight? #10

Open
michaelsjackson opened this issue May 23, 2020 · 1 comment
Open

Which plugins are available for highlight? #10

michaelsjackson opened this issue May 23, 2020 · 1 comment

Comments

@michaelsjackson
Copy link

Do we have any collection of available plugins for highlight, to be used as interesting starting points?

My goal is achieving this: https://gitlab.com/saalen/highlight/-/issues/157

@tajmone
Copy link
Owner

tajmone commented May 23, 2020

The plugins folder in the repository (also included with the distribution package) contains all the Highlight plugins:

https://gitlab.com/saalen/highlight/-/tree/master/plugins

some of them are intended for learning purposes, and you might find useful comments within them.

As far as I know, the Highlight project welcomes third party plugins contributions, so there shouldn't be plugins collections in the wild — the only reasons for a plugin not be included in the main project is either because its author doesn't want to share it (e.g. being proprietary), or because it was tailored for a particular use which makes it useless for most people, or due to license incompatibility.

As for what you're trying to achieve, I believe it's now possible to do so via some new plugins functions that were added fairly recently (e.g. AddKeyword(keyword, kwGroupID)) which allows to manually add a keyword to the internal list of keywords for the current syntax;

https://gitlab.com/saalen/highlight/-/blob/master/README_PLUGINS.adoc#user-content-functions-addkeywordremovekeyword

I'm not sure whether you can actually load a file though, since these are hook functions that are invoked when certain syntax-parsing events occur, whereas you're looking for a way to populate the list with the additional keywords before parsing even starts.

You might need to ask André (i.e. saalen on GitLab) on how/if this might be done. Chances are that there are undocumented features of the Lua/C++ interface that might allow you to hook into the parsing initialization stage and add extra keywords to a given group.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants