Little HTML/CSS trick ?
#1

Hey, if there are any HTML/CSS Programmers here, does anyone know how can I make my custom code higlighting, like the [pawn] tag at these forums.

For example:

pawn Код:
#include SOMETHING.inc

if(condition) ....
// Comment is different color
Now, how can I make a DIV in HTML which will behave in a similar way to [pawn] tag here, I mean;
that it changes/sets the color of preserved keywords in that DIV (or any other DOM element).

I need something that will automatically highlight the keywords in a DOM element.
Reply
#2

Код HTML:
<!--YER FOCKIN COMMENT HERE M8-->
http://www.w3schools.com/tags/tag_comment.asp
Reply
#3

Pygments or there is a JS library out there, a ****** search can help you
Reply
#4

nvm ...
Reply
#5

Quote:
Originally Posted by Ihateyou
Посмотреть сообщение
<code>hello world</code>

this?

http://www.w3schools.com/tags/tag_code.asp
I need something that will automatically highlight the keywords in a DOM element.
Reply
#6

then it's probably what RajatPawar said..
Reply
#7

Here.
Reply
#8

http://prismjs.com/

prismjs is probably exactly what you are looking for. Some people in here are not even reading what the content is (I am looking at you, digital angel)
Reply
#9

Similar to what mamorunl suggested, if you want to do the same thing but for it to be edited as well take a look at http://codemirror.net/ it has support for a bunch of different languages if you're wanting PAWN then you'll want http://codemirror.net/mode/clike/
Reply
#10

Yeah thanks for all that, I realised I could write the script myself, and put the colors that suit me, but thanks anyways, again.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)