WordPress:- SyntaxHighlighter Code Block – Modern Languages

Background

For those who enjoy sharing code online, WordPress offers a viable platform.

WordPress

SyntaxHighlighter Code Block

Languages

Supported Languages

  1. actionscript3
  2. bash
  3. clojure
  4. coldfusion
  5. cpp
  6. csharp
  7. css
  8. delphi
  9. diff
  10. erlang
  11. fsharp
  12. groovy
  13. html
  14. java
  15. javafx
  16. javascript
  17. latex (you can also render LaTeX)
  18. matlab (keywords only)
  19. objc
  20. perl
  21. php
  22. powershell
  23. python
  24. r
  25. ruby
  26. scala
  27. sql
  28. text
  29. vb
  30. xml

Newer Languages

Unfortunately, some of the newer languages are not supported.

Sample Code – go

Go by Example: Hello World

Link

Code Image

Code HTML

Code Rendered
 

package main

import "fmt"

func main() 
{
    fmt.Println("hello world")
}

 

Rust By Example – Hello World

Link

Code Image

Code HTML – Rust

Code Rendered – Rust

// This is the main function.
fn main()
{

// Statements here are executed when the compiled binary is called.

// Print text to the console.
println!("Hello World!");
}

 

 

Batch – Script

Link

Code Image

Code HTML – DOS – Batch

Code Rendered – DOS – Batch

@echo off
SET /A a = 5
SET /A b = 10
SET /A c = %a% + %b%
echo %c%
SET /A c = %a% – %b%
echo %c%
SET /A c = %b% / %a%
echo %c%
SET /A c = %b% * %a%
echo %c%

Issues

If you determine that your intended language is not supported, please specify a related language.

 

Workaround

Outline
  1. For Rust
    • Use a language similar to c, such as
      • cpp
      • csharp
  2. For DOS/Batch
    • Use a similar OS Scripting language, such as
      • bash ( Unix/Linux )

 

Rust
Code HTML – Rust – Intended – Cpp – Used

Code Rendered – Rust

// This is the main function.
fn main() 
{

    // Statements here are executed when the compiled binary is called.

    // Print text to the console.
    println!("Hello World!");
}

 

Code HTML – DOS Batch – Intended – Bash – Used

Code Rendered – DOS – Batch

@echo off 
SET /A a = 5 
SET /A b = 10 
SET /A c = %a% + %b% 
echo %c% 
SET /A c = %a% - %b% 
echo %c% 
SET /A c = %b% / %a% 
echo %c% 
SET /A c = %b% * %a% 
echo %c%

Summary

Not Noted, But are

There are languages that are not noted as supported such as:-

  1. go

But are supported, by specifying as is.

Not Noted, But are

There are languages that are not noted as supported such as:-

  1. Intented:- rust
    • Supported
      • cpp
      • csharp
  2. Intented:- DOS Batch
    • Supported
      • bash ( Unix / Linux )

 

But are supported, by specifying variant.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s