Little HTML/CSS trick ? -
Tagathron - 21.06.2014
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.
Re: Little HTML/CSS trick ? -
Twizted - 21.06.2014
Код HTML:
<!--YER FOCKIN COMMENT HERE M8-->
http://www.w3schools.com/tags/tag_comment.asp
Re: Little HTML/CSS trick ? -
RajatPawar - 21.06.2014
Pygments or there is a JS library out there, a ****** search can help you
Re: Little HTML/CSS trick ? -
Ihateyou - 21.06.2014
nvm ...
Re: Little HTML/CSS trick ? -
Tagathron - 21.06.2014
Quote:
Originally Posted by Ihateyou
|
I need something that will automatically highlight the keywords in a DOM element.
Re: Little HTML/CSS trick ? -
Ihateyou - 21.06.2014
then it's probably what RajatPawar said..
Re: Little HTML/CSS trick ? -
DiGiTaL_AnGeL - 21.06.2014
Here.
Re: Little HTML/CSS trick ? -
mamorunl - 21.06.2014
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)
Re: Little HTML/CSS trick ? -
NewerthRoleplay - 21.06.2014
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/
Re: Little HTML/CSS trick ? -
Tagathron - 23.06.2014
Yeah thanks for all that, I realised I could write the script myself, and put the colors that suit me, but thanks anyways, again.