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

Please include both a NPM requirable file and a CDN-ready distributable #2

Open
joshgoebel opened this issue Apr 9, 2021 · 1 comment

Comments

@joshgoebel
Copy link
Member

This issue is being opened as part of our iniative to make all 3rd party grammars:

  • easier to use for all end users
  • internally a bit more consistent (both to help end users and also encourage cross-maintenance)
  • ready to go for version 11

Please include a dist folder that includes a ready-to-go CDN distributable that can be used with a single line of JS. IE, our simple 3 install should "just work" without any other code or markup:

<script type="text/javascript" src="/path/to/highlight.min.js"></script>
<script type="text/javascript" src="/path/to/highlightjs-bbcode/bbcode.js"></script>
<script type="text/javascript">hljs.highlightAll();</script>

Your README optimally would also document this usage. Please see the robots-txt repository for a usage example.

Our build system can generate this file for you (and we recommend that). Using our internal build system also allows you to easily check your grammar for exponential or polynomical run-away regular expressions.

If you have any questions, feel free to ask!

Thanks,
Highlight.js Maintainer


You only have a single file now... which doesn't work with Node.js. Your source file should have a single export (the language function).. your distributable file should include the registerLanguage call. See the robots-txt repository linked to above for examples (I see you forked from that repo).

IE, the src/languages/bbcode.js file is the one you maintain (and can be required by Node.js, etc), and the dist/bbcode.min.js file is the one that our build system would auto-generate for you.

@cobaltt7
Copy link
Contributor

cobaltt7 commented Apr 23, 2021

I'm not really interested in maintaining this anymore. I moved it to the @highlightjs org so you can update it if you want.

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

No branches or pull requests

2 participants