Are all the languages included to the library?

65 views
Skip to first unread message

Vacheslav Starikov

unread,
Jun 3, 2015, 10:48:27 AM6/3/15
to highl...@googlegroups.com
Hello, 

Do I need to include each language js file that I want to use or all the languages are built into library js?

Thanks!

Oleg Efimov

unread,
Jun 3, 2015, 10:54:01 AM6/3/15
to highl...@googlegroups.com
Hello Vacheslav,

CDN build contains only languages from "common" category, as selected by default on download page: https://highlightjs.org/download/.
Any other language should be included after higlight.min.js from separate fil;es like https://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.6/languages/rust.min.js.

--
You received this message because you are subscribed to the Google Groups "highlight.js" group.
To unsubscribe from this group and stop receiving emails from it, send an email to highlightjs...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Best regards,
Oleg "Sannis" Efimov

http://sannis.ru

Duncan Mackenzie

unread,
Jul 25, 2016, 9:15:30 PM7/25/16
to highlight.js
After including a reference to an individual language file, do I have call registerLanguage for that additional language?

Thanks!

Alex Domoradov

unread,
Aug 21, 2016, 11:56:33 AM8/21/16
to highlight.js
I think you shouldn't call registerLanguage() because hljs.listLanguages() already contain the new language

<script charset="utf-8" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/highlight.min.js"</script>
<script charset="utf-8" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.6.0/languages/rust.min.js"></script>


> hljs.listLanguages()
["apache", "bash", "coffeescript", "cpp", "cs", "css", "diff", "http", "ini", "java", "javascript", "json", "makefile", "xml", "markdown", "nginx", "objectivec", "perl", "php", "python", "ruby", "sql", "rust"]



Ivan Sagalaev

unread,
Aug 21, 2016, 6:24:39 PM8/21/16
to highl...@googlegroups.com
Yes, individual language files on CDN are specifically build to register
themselves.
Reply all
Reply to author
Forward
0 new messages