Additional language for [code=...] bbcode

Additional language for [code=...] bbcode

CMTV

Well-known member

Andy.N

Well-known member
Great tutorial. This will be handy as i want to add latex and c++ to my site.
Questions.
How come latex does not render and just color? Im using mathjax js to render them.
What do i need to do to get the code bbcode to default to c++ and the rest needs to specify?
 

CMTV

Well-known member
What do i need to do to get the code bbcode to default to c++ and the rest needs to specify?
Great question. Added a new section to the guide.

How come latex does not render and just color? Im using mathjax js to render them.
I guess you need to prohibit MathJax to render LaTeX code in pre.bbCodeCode code elements. This can be done vie configuration .js file.
 

Andy.N

Well-known member
Thanks for the great guide. We are probably among few that use latex.
I guess you need to prohibit MathJax to render LaTeX code in pre.bbCodeCode code elements. This can be done vie configuration .js file.
Just to clarify, I have mathjax on XF 1.5 and plan to remove them when moving to XF 2. i have a test site with xf2 and try to see how it will render. It appears from your example that prism will not render latex. Can you confirm?
 

CMTV

Well-known member
It seems you are right. MathJax do not touch the code inside pre code elements. No need to edit it's config file!
math_jax_code.png
 

CMTV

Well-known member
MathJax renders math: LaTeX code -> Fancy math
PrismJS simply highlights the code (including LaTeX code). No render work. It serves a different purpose.
 

Joe Kuhn

Well-known member
To get started with FoxPro highlighting, I took the PrismJS file for QuickBasic, renamed it and changed the header and footer to say foxpro instead of visualbasic. After installation, I am getting coloring.

Next step is to look at translating the json file or the xml file for the other coloring system that was designed specifically for FoxPro into a JavaScript file for PrismJS. That other system is called Sublime. I have an experienced JavaScript programmer at work I will ask about this translation effort. Since my work and forum are all about translation efforts, this is very doable. There are free translators online that may help in this. Will see what the js guy says.
 
Top