Log in

View Full Version : "Toggle Plain Text" and bbcode for c++


Salman Qamar
10-08-2011, 04:23 AM
I want to creat a c++ programming forum. But i want to show code like shown on these forums.
http://www.programmingforums.org/thread38557.html
http://cboard.cprogramming.com/cplusplus-programming/141803-different-between-const-int***-int**-const.html

You can see that code is shown colored and with line no. In both forums there is also a toggle option.
Even [ php ] code [ / php ] do some better color but it neither show line number nor toggle option.
Can anyone please guide me that how i can achieve this on my forum.
Thanks in advance.
Sorry for any mistake as this is my first post.

kh99
10-08-2011, 10:22 AM
It appears that the site you linked to has done the syntax highlighting in javascript. If you view the page source you'll see that the C++ code is in plain text, contained in tags with a specific class, then at the very end there are some syntax highlighting .js files included.