Tag code recognize language (Wordpress)?

1

I do not understand much of this tag, but I wanted to know how to do a style scheme for that site in a Wordpress blog, code example:

string demo = "StackOverflow";
if(demo.Lenght == 13)
{
    demo += "Brasil";
}

How do you make it recognize reverse words and change colors?

    
asked by anonymous 16.07.2015 / 03:22

2 answers

2

If you just add the highlight to the post you can escape the code with [sourcecode language='nome da linguaguem'] :

[sourcecode language='javascript']
  string demo = "StackOverflow";
  if(demo.Lenght == 13){
    demo += "Brasil";
  }
[/sourcecode]

It is rendered as:

Thelistofavailablelanguagesandothersettingsareavailableat manual

    
16.07.2015 / 03:50
2

Inside a website, you will need a library to "burn" or stylize your code. Here's the link , which is a javascript library that can colorize your source code.

In a simple example, after adding the library to your page, you could use it for javascript:

<pre>
 <code class="javascript">
  string demo = "StackOverflow";
  if(demo.Lenght == 13)
  {
      demo += "Brasil";
  }
 </code>
</pre>
    
16.07.2015 / 03:42