wpDiscuz – Syntax Highlighter

wpDiscuz Syntax Highlighter addon displays formatted source code using the highlight.js JavaScript library in comment content. This addon supports almost all programming languages including Apache, Bash, C#, C++, CSS, HTML, XML, JSON, Java, JavaScript, Objective-C, PHP, Perl, Python, Ruby, SQL, Basic, Delphi, Erlang, Matlab, Prolog, ScalaScheme, Swift, TypeScript, VB.NET, Shell with dozens of different syntax highlighting styles. With this addons your commenters can insert different scripts and codes using the [</>] code toolbar button in comment editor. In the dashboard settings you can enable/disable certain programming language and change the highlighting style.

5 4 votes
Article Rating
Subscribe
Notify of
guest
32 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Richard
Richard
8 months ago

PHP

<?php
class Car {
    function Car() {
        $this->model = "Tesla";
    }
}


// create an object
$Lightning = new Car();


// show object properties
echo $Lightning->model;
?>
Juan
Juan
4 months ago
Reply to  Richard

public static String ipAleatoria() { StringBuilder sbIP = new StringBuilder(); for (int x=0; x<3; x++) { sbIP.append(String.valueOf(numeroAleatorio())).append(“.”); } sbIP.append(String.valueOf(numeroAleatorio())); return sbIP.toString(); }

Richard
Richard
8 months ago

Java Script

// ES5 syntax
function Person() {
  // we assign this to self so we can use it later
  var self = this;
  self.age = 0;

  setInterval(function growUp() {
    // self refers to the expected object
    self.age++;
  }, 1000);
}

// ES6 syntax
function Person(){
  this.age = 0;

  setInterval(() => {
    // this now refers to the Person object, brilliant!
    this.age++;
  }, 1000);
}

var p = new Person();
Ann
Ann
8 months ago
<!DOCTYPE html>
<html>
<body>


<h2>JavaScript Strings</h2>


<p>Strings can be written with double or single quotes.</p>


<p id="demo"></p>


<script>
document.getElementById("demo").innerHTML = 'John Doe';
</script>


</body>
</html>
Last edited 8 months ago by Ann
Ann
Ann
8 months ago
body {
  background-image: url("barn.jpg");
  background-repeat: repeat-y;
}

.text1 {
    font-size: 16px;
}
@media (min-width: 1200px) {
    .text1 {
        font-size: 20px;
    }
}
Ann
Ann
8 months ago
//this is the single line comment

/** This is multiline comment,
compiler ignores any code inside comment blocks.
**/

//This is the namespace, part of the standard .NET Framework Class Library
using System;
// namespace defines the scope of related objects into packages
namespace Learning.CSharp
{  
  // name of the class, should be same as of .cs file
  public class Program
  {
    //entry point method for console applications
   public static void Main()
    {
      //print lines on console
      Console.WriteLine("Hello, World!");
      //Reads the next line of characters from the standard input stream.Most common use is to pause program execution before clearing the console.
      Console.ReadLine();
    }
  }
}
Joseph
Joseph
8 months ago
def get_numbers_stack(list)
  stack  = [[0, []]]
  output = []

  until stack.empty?
    index, taken = stack.pop

    next output << taken if index == list.size

    stack.unshift [index + 1, taken]
    stack.unshift [index + 1, taken + [list[index]]]
  end

  output
end
Joseph
Joseph
8 months ago
# Python Program to find the area of triangle

a = 5
b = 6
c = 7

# Uncomment below to take inputs from the user
# a = float(input('Enter first side: '))
# b = float(input('Enter second side: '))
# c = float(input('Enter third side: '))

# calculate the semi-perimeter
s = (a + b + c) / 2

# calculate the area
area = (s*(s-a)*(s-b)*(s-c)) ** 0.5
print('The area of the triangle is %0.2f' %area)
Kelvin
Kelvin
7 months ago

Hello, i agree

Kelvin
Kelvin
7 months ago

Ok, testing

uLA
uLA
7 months ago

nONE

Last edited 7 months ago by uLA
uLA
uLA
7 months ago
ФУНКЦИЯ ОпрИзРСПоследнийОтветОтПользователя(Пользователь, ВидСообщения, МИД = НЕОПРЕДЕЛЕНО, ИсключитьКомандуИзПоиска = НЕОПРЕДЕЛЕНО)
	
	Запрос = НОВЫЙ Запрос;
	Запрос.УстановитьПараметр("Пользователь", Пользователь);
	
	Запрос.Текст = 
	"ВЫБРАТЬ ПЕРВЫЕ 1
	|	ИС.Период КАК Период,
	|	ИС.message_id,
	|	ИС.Команда,
	|	ИС.ОбъектВзаимодействия
	|ИЗ
	|	РегистрСведений.tel_ИсторияСообщений КАК ИС
	|ГДЕ
	|	ИС.Пользователь = &amp;Пользователь
	|	И ИС.ВидСообщения = &amp;ВидСообщения";
	ЕСЛИ НЕ МИД = НЕОПРЕДЕЛЕНО ТОГДА
		Запрос.УстановитьПараметр("МИД", МИД);
		Запрос.Текст = СтрЗаменить(Запрос.Текст, 
			"	И ИС.ВидСообщения = &amp;ВидСообщения", 
			"	И ИС.ВидСообщения = &amp;ВидСообщения И ИС.message_id = &amp;МИД");
	КОНЕЦЕСЛИ;
	ЕСЛИ ВидСообщения = НЕОПРЕДЕЛЕНО ТОГДА
		Запрос.Текст = СтрЗаменить(Запрос.Текст, "И ИС.ВидСообщения = &amp;ВидСообщения", "");
	ИНАЧЕ
		Запрос.УстановитьПараметр("ВидСообщения", ВидСообщения);
	КОНЕЦЕСЛИ;
Daniel
Daniel
5 months ago

Get-PnPSites

Daniel
Daniel
5 months ago
Get-PnPSites
Daniel
Daniel
5 months ago
UpdateContext({cvarUser : User})
Test
Test
5 months ago
=IF(MOD(IF(MID($D$2,1,1)*2>9,MID($D$2,1,1)*2-9,MID($D$2,1,1)*2)+MID($D$2,2,1)+IF(MID($D$2,3,1)*2>9,MID($D$2,3,1)*2-9,MID($D$2,3,1)*2)+MID($D$2,4,1)+IF(MID($D$2,5,1)*2>9,MID($D$2,5,1)*2-9,MID($D$2,5,1)*2)+MID($D$2,6,1)+IF(MID($D$2,7,1)*2>9,MID($D$2,7,1)*2-9,MID($D$2,7,1)*2)+MID($D$2,8,1)+IF(MID($D$2,9,1)*2>9,MID($D$2,9,1)*2-9,MID($D$2,9,1)*2)+MID($D$2,10,1)+IF(MID($D$2,11,1)*2>9,MID($D$2,11,1)*2-9,MID($D$2,11,1)*2)+MID($D$2,12,1)+IF(MID($D$2,13,1)*2>9,MID($D$2,13,1)*2-9,MID($D$2,13,1)*2)+MID($D$2,14,1)+IF(MID($D$2,15,1)*2>9,MID($D$2,15,1)*2-9,MID($D$2,15,1)*2)+MID($D$2,16,1),10)=0,VLOOKUP(--LEFT($D$2,6),A1:B100,2,0),"NOT OK")
Dima
Dima
5 months ago

.wrapper {
   display: flex;
   flex-direction: column;
   min-height: 100%;
}

Dima
Dima
5 months ago
.wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100%;
}
Juan
Juan
4 months ago
public static String ipAleatoria() {
    StringBuilder sbIP = new StringBuilder();
    for (int x=0; x<3; x++) {
        sbIP.append(String.valueOf(numeroAleatorio())).append(".");
    }
    sbIP.append(String.valueOf(numeroAleatorio()));

    return sbIP.toString();

}
test
test
4 months ago
<?php
echo "Hello World";
?>
Last edited 4 months ago by test
anony
anony
4 months ago

best text

new quote

text
line

<?php
echo 'Hello World!';
vknjbjcs
vknjbjcs
4 months ago

var koi

vknjbjcs
vknjbjcs
4 months ago

var k

Bartosz
Bartosz
3 months ago
<?php
phpinfo();
Test
Test
3 months ago
<nav id="site-navigation" class="primary-navigation" role="navigation" aria-label="Primary menu">
        <div class="primary-menu-container"><ul id="primary-menu-list" class="menu-wrapper"><li id="menu-item-29" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-29"><a href="#">HYNEWS</a></li>
<li id="menu-item-38" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-home current-menu-item page_item page-item-27 current_page_item menu-item-38"><a href="http://hylife.hybrid-technologies.vn/" aria-current="page">HYBOX</a></li>
<li id="menu-item-39" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-39"><a href="#">HYLIFE</a></li>
<li id="menu-item-40" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-40"><a href="http://hylife.hybrid-technologies.vn/hylearn/">HYLEARN</a></li>
<li id="menu-item-41" class="menu-item menu-item-type-custom menu-item-object-custom menu-item-41"><a href="#">DOCUMENT</a></li>
</ul></div>    </nav>
hbhjj
hbhjj
3 months ago

Hola

Higsfd
Higsfd
3 months ago

Check this code

<?php class Car {
  function Car() {
    $this->model = "Tesla";  }}
// create an object
$Lightning = new Car();
// show object properties
echo $Lightning->model; ?>
Lynn
Lynn
3 months ago
<?php
   echo "Hello World";
?>
asdfasfd
asdfasfd
3 months ago
<?php
class Car {
    function Car() {
        $this->model = "Tesla";
    }
}


// create an object
$Lightning = new Car();


// show object properties
echo $Lightning->model;
?>

TINA ZHANG
TINA ZHANG
2 months ago

很好呀

nawaraj
nawaraj
1 month ago
#include<stdio.h>

int palindrome(int);

int main() {
  int x,check;
  printf("Enter any number: \n");
  scanf("%d",&x);
  check = palindrome(x);
  if(check==1)
  printf("%d is a palindrome.",x);
  else
  printf("%d is not a palindrome.",x);
  
  return 0;
}

int palindrome(int n) {
  int rev = 0,rem,temp;
  temp=n;
  while(n != 0) {
    rem = n%10;
    rev = rev*10 + rem;
    n/=10;
  }
  if(temp==rev)
  return 1;
  else
  return 2;
}
dsdsd
dsdsd
9 days ago
for i in mylist :
  print(i)