Truemag

  • Categories
    • Tips And Tricks
    • Internet
    • PHP
    • Javascript
    • CSharp
    • SQL Server
    • Linux
  • Lastest Videos
  • Our Demos
  • About
  • Contact
  • Home
  • Write With Us
  • Job Request
Home Internet WordPress SyntaxHighlighter Shortcode Parameters and Language Syntax

WordPress SyntaxHighlighter Shortcode Parameters and Language Syntax

SyntaxHighlighter is a WordPress plugin which allows you to easily post syntax-highlighted code to your site without losing it’s formatting or making any manual changes. There are some attributes and language syntax I need to remember whenever I want create a new tutorial but it’s not really easy for me to remember all of them.

So, I post all Shortcode Parameters and supported language syntax for a quick reference.

Shortcode Parameters

  • lang or language — The language syntax to highlight with. You can alternately just use that as the tag.
  • autolinks — Toggle automatic URL linking.
  • classname — Add an additional CSS class to the code box.
  • collapse — Toggle collapsing the code box by default, requiring a click to expand it. Good for large code posts.
  • firstline — An interger specifying what number the first line should be (for the line numbering).
  • gutter — Toggle the left-side line numbering.
  • highlight — A comma-sperated list of line numbers to highlight. You can also specify a range. Example: 2,5-10,12
  • htmlscript — Toggle highlighting any extra HTML/XML. Good for when you’re mixing HTML/XML with another language, such as having PHP inside an HTML web page. The above preview has it enabled for example. This only works with certain languages.
  • light — Toggle light mode which disables the gutter and toolbar all at once.
  • padlinenumbers — Controls line number padding. Valid values are false (no padding), true (automatic padding), or an integer (forced padding).
  • title (v3 only) — Sets some text to show up before the code. Very useful when combined with the collapse parameter.
  • toolbar — Toggle the toolbar (buttons in v2, the about question mark in v3)
  • wraplines (v2 only) — Toggle line wrapping.

Some example shortcodes:

  • [php]your code here[/php]
  • [css autolinks="false" classname="myclass" collapse="false" firstline="1" gutter="true" highlight="1-3,6,9" htmlscript="false" light="false" padlinenumbers="false" smarttabs="true" tabsize="4" toolbar="true" title="example-filename.php"]your code here[/css]
  • [code lang="js"]your code here[/code]
  • [sourcecode language="plain"]your code here[/sourcecode]

Supported language syntax:

Brush name Brush aliases
ActionScript3 as3, actionscript3
Bash/shell bash, shell
ColdFusion cf, coldfusion
C# c-sharp, csharp
C++ cpp, c
CSS css
Delphi delphi, pas, pascal
Diff diff, patch
Erlang erl, erlang
Groovy groovy
JavaScript js, jscript, javascript
Java java
JavaFX jfx, javafx
Perl perl, pl
PHP php
Plain Text plain, text
PowerShell ps, powershell
Python py, python
Ruby rails, ror, ruby
Scala scala
SQL sql
Visual Basic vb, vbnet
XML xml, xhtml, xslt, html, xhtml
Mar 22, 2011Hoan Huynh
Build search box for my website at Google.comTop free online text and webpage translator services
You Might Also Like:
  • JavaScript Open A New Tab With JQuery
  • Place Facebook Like Button On WordPress
  • Show Error Message On WordPress Custom Login Template Page
  • Facebook Like Button And Recommend Button With fb:like, iframe and html5
  • How to create new custom menu item in your wordpress back end?
  • Auto Load YouTube Video As A Popup With JQuery FancyBox
  • FancyBox Redirect To A Predefined URL When Click On Image
  • Top Plugins Should Be Installed On WordPress
  • Auto check and fix spelling, missed words, style, and grammar in WordPress
  • innerText May Not Work On Mozilla Firefox
Hoan Huynh

Hoan Huynh is the founder and head of 4rapiddev.com. Reach him at [email protected]

11 years ago InternetShortcode, Syntax, SyntaxHighlighter, Wordpress244
0
GooglePlus
0
Facebook
0
Twitter
0
Digg
0
Delicious
0
Stumbleupon
0
Linkedin
0
Pinterest
Most Viewed
PHP Download Image Or File From URL
24,550 views
Notepad Plus Plus Compare Plugin
How To Install Compare Text Plugin In Notepad Plus Plus
21,886 views
Microsoft SQL Server 2008 Attach Remove Log
Delete, Shrink, Eliminate Transaction Log .LDF File
17,740 views
JQuery Allow only numeric characters or only alphabet characters in textbox
15,063 views
C# Read Json From URL And Parse/Deserialize Json
11,795 views
4 Rapid Development is a central page that is targeted at newbie and professional programmers, database administrators, system admin, web masters and bloggers.
Recent Posts
  • Things to Learn about Installingderm Loan Type S
  • Online Photo Editor – Free Photoediting Software
  • A Guide to Finding the Best Paper Sellers
  • Photoediting in Home Isn’t Hard to Do!

  • Free Photo Editor Online
Categories
  • CSharp (45)
  • Facebook Graph API (19)
  • Google API (7)
  • Internet (87)
  • iPhone XCode (8)
  • Javascript (35)
  • Linux (27)
  • MySQL (16)
  • PHP (84)
  • Problem Issue Error (29)
  • Resources (32)
  • SQL Server (25)
  • Timeline (5)
  • Tips And Tricks (141)
  • Uncategorized (647)
Recommended
  • Custom Software Development Company
  • Online Useful Tools
  • Premium Themes
  • VPS
2014 © 4 Rapid Development