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 2 votes
Article Rating
Subscribe
Notify of
guest
7 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Richard
Richard
1 month ago

PHP

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


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


// show object properties
echo $Lightning->model;
?>
Richard
Richard
1 month 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
1 month 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 1 month ago by Ann
Ann
Ann
1 month 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
1 month 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
1 month 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
1 month 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)