Skip to content
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

Add Bro/Zeek #1997

Closed
wants to merge 1 commit into from
Closed

Conversation

lilyinstarlight
Copy link

Add support for the Bro language from https://zeek.org/.

Bro is a programming language designed specifically to be able to
represent network-related abstractions (e.g. addresses and ports) and
as such offers a great deal of functionality and flexibility in terms
of helping you accomplish your network-monitoring goals.

Other syntax highlighters I looked at supported Bro so hopefully this a good language to merge. I took the three regexes at the top from Pygments, but all of the other highlighting code was done by me.

Let me know if I did everything right or if it can be improved. It worked for all of the scripts I tried it on but I will continue to do testing since I'll be using it after this gets merged.

Thanks a bunch!

Add support for the Bro language from https://zeek.org/.

Bro is a programming language designed specifically to be able to
represent network-related abstractions (e.g. addresses and ports) and
as such offers a great deal of functionality and flexibility in terms
of helping you accomplish your network-monitoring goals.
@joshgoebel joshgoebel changed the title Add Bro/Zeek language support Add Bro/Zeek Oct 24, 2019
@joshgoebel
Copy link
Member

joshgoebel commented Dec 24, 2019

@fkmclane

First of all, truly sorry for the long delay in anyone responding to this PR.

Thank you so much for desiring to contribute and writing a language grammar. Unfortunately, we currently are no longer accepting new languages into the core repository. The existing maintainers simply don't have time to maintain new languages (fixing bugs, dealing with issues, etc). We'd still love to host your language as a 3rd party module though - if you're willing to help maintain it.

It's easy to turn your language into a module that anyone who likes can easily integrate with Highlight.js using a single line of code:

<script src="/path/to/highlight.min.js"></script>
<!-- they'd simply add this single line -->
<script src="/path/to/highlightjs-bro_zeek.js"></script> 
<script>hljs.initHighlightingOnLoad();</script>

If you'd like to become the maintainer for this language then we're happy to create a new repository in the highlightjs organization and host the repository there. That assumes you'd be open to reviewing issues and fixing bugs as they arise. You're also welcome to host the repo yourself and we'll link to it from our README.

There isn't much in the way of how to docs on this yet, but there are sample repositories and it's honestly pretty easy. We're still fleshing out an official "spec" for 3rd party modules, but even after that's done it should require minimal changes from the examples we have already. IE, if you wanted to get started now there isn't any big reason to wait.

My own robots.txt grammar repository is a great, simple example:

https://github.com/highlightjs/highlightjs-robots-txt

If you have any questions feel free to ask.

@joshgoebel
Copy link
Member

Closing for inactivity; (also finally cleaning all these old PRs out for the new year).

As mentioned above if you're interested in becoming the maintainer of a 3rd party module, please respond [whenever you find time] and we'd be happy to help you get started.

@joshgoebel joshgoebel closed this Jan 2, 2020
@lilyinstarlight
Copy link
Author

Hey thanks for the response!

I totally understand closing this and yeah, language proliferation can be a problem for maintainability. Shortly after I made this PR I rewrote a lot of it because I realized I did some dumbs here and there and fully renamed it to Zeek (while having "bro" as an alias) but I did not finish that before getting busy with other work. If I do go back to that and finish it, I might be interested in hosting it as a third party module and would be open to reviewing issues. Should I contact you for that when I do get it ready?

@joshgoebel
Copy link
Member

Sure just ping this thread or post a new issue when ready.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants