Crayon Syntax Highlighter - Version 1.4.0

Version Description

  • Added all other global settings for easy overriding: http://ak.net84.net/projects/crayon-settings/
  • Fixed issues with variables and entites in language regex
  • Added Epicgeeks theme made by Joe Newing of epicgeeks.net
  • Help updated
  • Fixed notice on missing jQuery string in settings
  • Reduced number of setting reads
  • Setting name cleanup
  • Added a donate button, would appreciate any support offered and I hope you find Crayon useful
  • String to boolean in util fixed
Download this release

Release Info

Developer akarmenia
Plugin Icon wp plugin Crayon Syntax Highlighter
Version 1.4.0
Comparing to
See all releases

Code changes from version 1.3.5 to 1.4.0

crayon_formatter.class.php CHANGED
@@ -74,12 +74,14 @@ class CrayonFormatter {
74
 
75
  // The line number to start from
76
  $start_line = $hl->setting_val(CrayonSettings::START_LINE);
 
 
77
  for ($i = 1; $i <= $hl->line_count(); $i++) {
78
  $code_line = $code_lines[0][$i - 1];
79
  // Check if the current line has been selected
80
  $marked_lines = $hl->marked();
81
  // Check if lines need to be marked as important
82
- if ($hl->setting_val(CrayonSettings::MARKING) && in_array($i, $marked_lines)) {
83
  $marked_num = ' crayon-marked-num';
84
  $marked_line = ' crayon-marked-line';
85
  // If multiple lines are marked, only show borders for top and bottom lines
@@ -96,7 +98,7 @@ class CrayonFormatter {
96
  $marked_num = $marked_line = '';
97
  }
98
  // Stripe odd lines
99
- if ($hl->setting_val(CrayonSettings::STRIPED) && $i % 2 == 0) {
100
  $striped_num = ' crayon-striped-num';
101
  $striped_line = ' crayon-striped-line';
102
  } else {
@@ -203,14 +205,14 @@ class CrayonFormatter {
203
  /* The table is rendered invisible by CSS and enabled with JS when asked to. If JS
204
  is not enabled or fails, the toolbar won't work so there is no point to display it. */
205
 
 
206
  $toolbar = '
207
  <div class="crayon-toolbar" settings="'.$toolbar_settings.'">'.$print_title.'
208
- <div class="crayon-tools">'.$print_nums_button.$print_copy_button.$print_popup_button.$print_plain_button.$print_lang.'</div>
209
  </div><div>'.$print_plain.'</div>'.'<div class="crayon-info"></div>';
210
 
211
-
212
  } else {
213
- $toolbar = $plain_settings = '';
214
  }
215
 
216
  // Print strings
74
 
75
  // The line number to start from
76
  $start_line = $hl->setting_val(CrayonSettings::START_LINE);
77
+ $marking = $hl->setting_val(CrayonSettings::MARKING);
78
+ $striped = $hl->setting_val(CrayonSettings::STRIPED);
79
  for ($i = 1; $i <= $hl->line_count(); $i++) {
80
  $code_line = $code_lines[0][$i - 1];
81
  // Check if the current line has been selected
82
  $marked_lines = $hl->marked();
83
  // Check if lines need to be marked as important
84
+ if ($marking && in_array($i, $marked_lines)) {
85
  $marked_num = ' crayon-marked-num';
86
  $marked_line = ' crayon-marked-line';
87
  // If multiple lines are marked, only show borders for top and bottom lines
98
  $marked_num = $marked_line = '';
99
  }
100
  // Stripe odd lines
101
+ if ($striped && $i % 2 == 0) {
102
  $striped_num = ' crayon-striped-num';
103
  $striped_line = ' crayon-striped-line';
104
  } else {
205
  /* The table is rendered invisible by CSS and enabled with JS when asked to. If JS
206
  is not enabled or fails, the toolbar won't work so there is no point to display it. */
207
 
208
+ $buttons = $print_nums_button.$print_copy_button.$print_popup_button.$print_plain_button.$print_lang;
209
  $toolbar = '
210
  <div class="crayon-toolbar" settings="'.$toolbar_settings.'">'.$print_title.'
211
+ <div class="crayon-tools">'.$buttons.'</div>
212
  </div><div>'.$print_plain.'</div>'.'<div class="crayon-info"></div>';
213
 
 
214
  } else {
215
+ $toolbar = $buttons = $plain_settings = '';
216
  }
217
 
218
  // Print strings
crayon_highlighter.class.php CHANGED
@@ -279,7 +279,6 @@ class CrayonHighlighter {
279
  return $this->settings->get($mixed);
280
  } else if (is_array($mixed)) {
281
  $this->settings->set($mixed);
282
-
283
  return TRUE;
284
  }
285
  return FALSE;
279
  return $this->settings->get($mixed);
280
  } else if (is_array($mixed)) {
281
  $this->settings->set($mixed);
 
282
  return TRUE;
283
  }
284
  return FALSE;
crayon_settings.class.php CHANGED
@@ -42,7 +42,7 @@ class CrayonSettings {
42
  const TOOLBAR_HIDE = 'toolbar-hide';
43
  const TOOLBAR_DELAY = 'toolbar-delay';
44
  const COPY = 'copy';
45
- const POPUP = 'POPUP';
46
  const SHOW_LANG = 'show-lang';
47
  const SHOW_TITLE = 'show-title';
48
  const STRIPED = 'striped';
@@ -305,6 +305,11 @@ class CrayonSettings {
305
  return '';
306
  }
307
  // Validations
 
 
 
 
 
308
  switch ($name) {
309
  case CrayonSettings::LOCAL_PATH:
310
  $path = parse_url($value, PHP_URL_PATH);
@@ -320,6 +325,11 @@ class CrayonSettings {
320
  case CrayonSettings::TAB_SIZE:
321
  $value = abs($value);
322
  break;
 
 
 
 
 
323
  case CrayonSettings::THEME:
324
  $value = strtolower($value);
325
  // XXX validate settings here
@@ -339,6 +349,10 @@ class CrayonSettings {
339
 
340
  // If a setting is given, it is automatically enabled
341
  foreach ($settings as $name=>$value) {
 
 
 
 
342
  if ($name == 'min-height' || $name == 'max-height' || $name == 'height') {
343
  self::smart_hw($name, CrayonSettings::HEIGHT_SET, CrayonSettings::HEIGHT_MODE, CrayonSettings::HEIGHT_UNIT, $settings);
344
  } else if ($name == 'min-width' || $name == 'max-width' || $name == 'width') {
@@ -353,10 +367,30 @@ class CrayonSettings {
353
  $settings[CrayonSettings::BOTTOM_SET] = TRUE;
354
  } else if ($name == CrayonSettings::RIGHT_MARGIN) {
355
  $settings[CrayonSettings::RIGHT_SET] = TRUE;
 
 
356
  } else if ($name == CrayonSettings::H_ALIGN) {
357
  $settings[CrayonSettings::FLOAT_ENABLE] = TRUE;
358
- } else if ($name == CrayonSettings::H_ALIGN) {
359
- $settings[CrayonSettings::FLOAT_ENABLE] = TRUE;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
360
  }
361
  }
362
 
@@ -612,6 +646,21 @@ class CrayonSetting {
612
  $this->value = $index;
613
  }
614
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
615
 
616
  }
617
 
42
  const TOOLBAR_HIDE = 'toolbar-hide';
43
  const TOOLBAR_DELAY = 'toolbar-delay';
44
  const COPY = 'copy';
45
+ const POPUP = 'popup';
46
  const SHOW_LANG = 'show-lang';
47
  const SHOW_TITLE = 'show-title';
48
  const STRIPED = 'striped';
305
  return '';
306
  }
307
  // Validations
308
+ if ($name == CrayonSettings::HEIGHT || $name == CrayonSettings::WIDTH) {
309
+ if ($value < 0) {
310
+ $value = 0;
311
+ }
312
+ }
313
  switch ($name) {
314
  case CrayonSettings::LOCAL_PATH:
315
  $path = parse_url($value, PHP_URL_PATH);
325
  case CrayonSettings::TAB_SIZE:
326
  $value = abs($value);
327
  break;
328
+ case CrayonSettings::FONT_SIZE:
329
+ if ($value < 1) {
330
+ $value = 1;
331
+ }
332
+ break;
333
  case CrayonSettings::THEME:
334
  $value = strtolower($value);
335
  // XXX validate settings here
349
 
350
  // If a setting is given, it is automatically enabled
351
  foreach ($settings as $name=>$value) {
352
+ if ( ($setting = CrayonGlobalSettings::get($name)) !== FALSE && is_bool($setting->def()) ) {
353
+ $value = CrayonUtil::str_to_bool($value);
354
+ }
355
+
356
  if ($name == 'min-height' || $name == 'max-height' || $name == 'height') {
357
  self::smart_hw($name, CrayonSettings::HEIGHT_SET, CrayonSettings::HEIGHT_MODE, CrayonSettings::HEIGHT_UNIT, $settings);
358
  } else if ($name == 'min-width' || $name == 'max-width' || $name == 'width') {
367
  $settings[CrayonSettings::BOTTOM_SET] = TRUE;
368
  } else if ($name == CrayonSettings::RIGHT_MARGIN) {
369
  $settings[CrayonSettings::RIGHT_SET] = TRUE;
370
+ } else if ($name == CrayonSettings::ERROR_MSG) {
371
+ $settings[CrayonSettings::ERROR_MSG_SHOW] = TRUE;
372
  } else if ($name == CrayonSettings::H_ALIGN) {
373
  $settings[CrayonSettings::FLOAT_ENABLE] = TRUE;
374
+ $value = CrayonUtil::tlower($value);
375
+ $values = array('none'=>0, 'left'=>1, 'center'=>2, 'right'=>3);
376
+ if (array_key_exists($value, $values)) {
377
+ $settings[CrayonSettings::H_ALIGN] = $values[$value];
378
+ }
379
+ } else if ($name == CrayonSettings::SHOW_LANG) {
380
+ $value = CrayonUtil::tlower($value);
381
+ $values = array('found'=>0, 'always'=>1, 'true'=>1, 'never'=>2, 'false'=>2);
382
+ if (array_key_exists($value, $values)) {
383
+ $settings[CrayonSettings::SHOW_LANG] = $values[$value];
384
+ }
385
+ } else if ($name == CrayonSettings::TOOLBAR) {
386
+ if ( CrayonUtil::tlower($value) == 'always' ) {
387
+ $settings[CrayonSettings::TOOLBAR] = 1;
388
+ }
389
+ else if (CrayonUtil::str_to_bool($value) === FALSE) {
390
+ $settings[CrayonSettings::TOOLBAR] = 2;
391
+ } else if (CrayonUtil::str_to_bool($value, FALSE)) {
392
+ $settings[CrayonSettings::TOOLBAR] = 0;
393
+ }
394
  }
395
  }
396
 
646
  $this->value = $index;
647
  }
648
  }
649
+
650
+ /**
651
+ * Finds the index of a string in an array setting
652
+ */
653
+ function find_index($str) {
654
+ if (!$this->is_array || is_string($str)) {
655
+ return FALSE;
656
+ }
657
+ for ($i = 0; $i < count($this->default); $i++) {
658
+ if ($this->default[$i] == $str) {
659
+ return $i;
660
+ }
661
+ }
662
+ return FALSE;
663
+ }
664
 
665
  }
666
 
crayon_settings_wp.class.php CHANGED
@@ -50,7 +50,7 @@ class CrayonSettingsWP {
50
  public static function admin_scripts() {
51
  global $CRAYON_VERSION;
52
  wp_enqueue_script('crayon_jquery', plugins_url(CRAYON_JQUERY, __FILE__), array(), $CRAYON_VERSION);
53
- wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array(crayon_jquery), $CRAYON_VERSION);
54
  wp_enqueue_script('crayon_admin_js', plugins_url(CRAYON_JS_ADMIN, __FILE__), array('crayon_jquery'), $CRAYON_VERSION);
55
  wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('crayon_jquery'), $CRAYON_VERSION);
56
  }
@@ -523,23 +523,36 @@ class CrayonSettingsWP {
523
  public static function info() {
524
  global $CRAYON_VERSION, $CRAYON_DATE, $CRAYON_AUTHOR, $CRAYON_TWITTER, $CRAYON_EMAIL;
525
  echo '<a name="info"></a>';
526
- $version = '<b>Version:</b> ' . $CRAYON_VERSION . '<span class="crayon-span" style="width: 40px"></span>';
527
- $date = '<b>Build Date:</b> ' . $CRAYON_DATE;
528
  $developer = '<b>Developer:</b> ' . $CRAYON_AUTHOR;
 
 
 
 
 
 
 
 
 
 
529
  $links = '<a id="twitter-icon" href="' . $CRAYON_TWITTER . '" target="_blank"></a>
530
- <a id="gmail-icon" href="mailto:' . $CRAYON_EMAIL . '" target="_blank"></a>';
 
531
  echo '
532
  <table id="crayon-info" border="0">
533
  <tr>
534
- <td>'.$version.'</td>
535
- <td>'.$date.'</td>
536
  </tr>
537
  <tr>
538
  <td>'.$developer.'</td>
539
  <td></td>
540
  </tr>
541
  <tr>
542
- <td colspan="2" style="text-align: centera;">'.$links.'</td>
 
 
 
543
  </tr>
544
  </table>';
545
  }
50
  public static function admin_scripts() {
51
  global $CRAYON_VERSION;
52
  wp_enqueue_script('crayon_jquery', plugins_url(CRAYON_JQUERY, __FILE__), array(), $CRAYON_VERSION);
53
+ wp_enqueue_script('crayon_jquery_popup', plugins_url(CRAYON_JQUERY_POPUP, __FILE__), array('crayon_jquery'), $CRAYON_VERSION);
54
  wp_enqueue_script('crayon_admin_js', plugins_url(CRAYON_JS_ADMIN, __FILE__), array('crayon_jquery'), $CRAYON_VERSION);
55
  wp_enqueue_script('crayon_js', plugins_url(CRAYON_JS, __FILE__), array('crayon_jquery'), $CRAYON_VERSION);
56
  }
523
  public static function info() {
524
  global $CRAYON_VERSION, $CRAYON_DATE, $CRAYON_AUTHOR, $CRAYON_TWITTER, $CRAYON_EMAIL;
525
  echo '<a name="info"></a>';
526
+ $version = '<b>Version:</b> ' . $CRAYON_VERSION;
527
+ $date = $CRAYON_DATE;
528
  $developer = '<b>Developer:</b> ' . $CRAYON_AUTHOR;
529
+ $paypal = '<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
530
+ <input type="hidden" name="cmd" value="_s-xclick">
531
+ <input type="hidden" name="encrypted" value="-----BEGIN PKCS7-----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-----END PKCS7-----
532
+ ">
533
+ <input type="image" src="https://www.paypalobjects.com/en_AU/i/btn/btn_donate_SM.gif" border="0" name="submit" alt="PayPal � The safer, easier way to pay online.">
534
+ <img alt="" border="0" src="https://www.paypalobjects.com/en_AU/i/scr/pixel.gif" width="1" height="1">
535
+ </form>
536
+ ';
537
+ $paypal = '<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=AW99EMEPQ4CFE&lc=AU&item_name=Crayon%20Syntax%20Highlighter%20Donation&item_number=crayon%2ddonate&currency_code=AUD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted" target="_blank"><img src="'.plugins_url(CRAYON_DONATE_BUTTON, __FILE__).'"></a>
538
+ ';
539
  $links = '<a id="twitter-icon" href="' . $CRAYON_TWITTER . '" target="_blank"></a>
540
+ <a id="gmail-icon" href="mailto:' . $CRAYON_EMAIL . '" target="_blank"></a><div id="crayon-donate">' . $paypal . '</div>';
541
+ //<a id="donate-icon" href="" target="_blank"></a>
542
  echo '
543
  <table id="crayon-info" border="0">
544
  <tr>
545
+ <td>'.$version.' - '.$date.'</td>
 
546
  </tr>
547
  <tr>
548
  <td>'.$developer.'</td>
549
  <td></td>
550
  </tr>
551
  <tr>
552
+ <td colspan="2">The result of innumerable hours of hard work over many months. It\'s an ongoing project, keep me motivated!</td>
553
+ </tr>
554
+ <tr>
555
+ <td colspan="2">'.$links.'</td>
556
  </tr>
557
  </table>';
558
  }
crayon_wp.class.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Crayon Syntax Highlighter
4
  Plugin URI: http://ak.net84.net/
5
  Description: Supports multiple languages, themes, highlighting from a URL, local file or post text. <a href="options-general.php?page=crayon_settings">View Settings.</a>
6
- Version: 1.3.5
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  License: GPL2
3
  Plugin Name: Crayon Syntax Highlighter
4
  Plugin URI: http://ak.net84.net/
5
  Description: Supports multiple languages, themes, highlighting from a URL, local file or post text. <a href="options-general.php?page=crayon_settings">View Settings.</a>
6
+ Version: 1.4.0
7
  Author: Aram Kocharyan
8
  Author URI: http://ak.net84.net/
9
  License: GPL2
css/admin_style.css CHANGED
@@ -157,7 +157,7 @@
157
  margin: 0px;
158
  }
159
 
160
- #gmail-icon, #twitter-icon {
161
  width: 24px;
162
  height: 24px;
163
  display: inline-block;
@@ -170,4 +170,18 @@
170
 
171
  #gmail-icon {
172
  background: url(images/google.png);
173
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  margin: 0px;
158
  }
159
 
160
+ #gmail-icon, #twitter-icon, #donate-icon {
161
  width: 24px;
162
  height: 24px;
163
  display: inline-block;
170
 
171
  #gmail-icon {
172
  background: url(images/google.png);
173
+ }
174
+
175
+ #donate-icon {
176
+ background: url(images/donate.png);
177
+ width: 75px;
178
+ }
179
+
180
+ #crayon-donate,
181
+ #crayon-donate input {
182
+ margin: 0;
183
+ display: inline;
184
+ padding: 0;
185
+ }
186
+
187
+
css/images/donate.png ADDED
Binary file
global.php CHANGED
@@ -57,6 +57,7 @@ define('CRAYON_JS_ADMIN', CRAYON_JS_DIR . 'crayon_admin.js');
57
  define('CRAYON_STYLE', CRAYON_CSS_DIR . 'style.css');
58
  define('CRAYON_STYLE_ADMIN', CRAYON_CSS_DIR . 'admin_style.css');
59
  define('CRAYON_LOGO', CRAYON_CSS_DIR . 'images/crayon_logo.png');
 
60
 
61
  // PHP Files
62
  define('CRAYON_FORMATTER_PHP', CRAYON_ROOT_PATH . 'crayon_formatter.class.php');
57
  define('CRAYON_STYLE', CRAYON_CSS_DIR . 'style.css');
58
  define('CRAYON_STYLE_ADMIN', CRAYON_CSS_DIR . 'admin_style.css');
59
  define('CRAYON_LOGO', CRAYON_CSS_DIR . 'images/crayon_logo.png');
60
+ define('CRAYON_DONATE_BUTTON', CRAYON_CSS_DIR . 'images/donate.png');
61
 
62
  // PHP Files
63
  define('CRAYON_FORMATTER_PHP', CRAYON_ROOT_PATH . 'crayon_formatter.class.php');
langs/default/default.txt CHANGED
@@ -3,18 +3,18 @@
3
  # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
 
5
  NAME Default
6
- VERSION 1.0
7
 
8
  COMMENT (/\*.*?\*/)|(//.*?$)
9
  STRING ((?<!\\)".*?(?<!\\)")|((?<!\\)'.*?(?<!\\)')
10
 
11
  STATEMENT \b(?alt:statement.txt)\b
12
- RESERVED \b(?alt:reserved.txt)\b
13
  TYPE \b(?alt:type.txt)\b
14
  MODIFIER \b(?alt:modifier.txt)\b
15
 
16
- ENTITY (\b[a-z_]\w*\b(?=\s*\([^\)]*\)))|((\b[a-z_]\w*\b)(?=[^};\)]*{))
17
- VARIABLE \b[A-Za-z_]\w*(?=\s*[\.;\[])
18
  IDENTIFIER \b[A-Za-z_]\w*\b
19
  CONSTANT (?<!\w)\.?[0-9][\w]*
20
  OPERATOR (?alt:operator.txt)
3
  # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
 
5
  NAME Default
6
+ VERSION 1.1
7
 
8
  COMMENT (/\*.*?\*/)|(//.*?$)
9
  STRING ((?<!\\)".*?(?<!\\)")|((?<!\\)'.*?(?<!\\)')
10
 
11
  STATEMENT \b(?alt:statement.txt)\b
12
+ RESERVED \b(?<![:\.])(?alt:reserved.txt)(?![:\.])\b
13
  TYPE \b(?alt:type.txt)\b
14
  MODIFIER \b(?alt:modifier.txt)\b
15
 
16
+ ENTITY (\b[a-z_]\w*\b(?=\s*\([^\)]*\)))|((?<!\.)(\b[a-z_]\w*\b)(?=[^},.:;\)]*{))
17
+ VARIABLE \b(?<=\.)\s*[A-Za-z_]\w*
18
  IDENTIFIER \b[A-Za-z_]\w*\b
19
  CONSTANT (?<!\w)\.?[0-9][\w]*
20
  OPERATOR (?alt:operator.txt)
langs/js/js.txt CHANGED
@@ -3,18 +3,18 @@
3
  # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
 
5
  NAME JavaScript
6
- VERSION 1.0
7
 
8
  COMMENT (?default)
9
  STRING (?default)
10
 
11
  STATEMENT (?default)
12
- RESERVED (?default)|\b(?-i:(?alt:reserved.txt))\b
13
  TYPE (?default)
14
  MODIFIER (?default)
15
 
16
  ENTITY (?default)
17
- VARIABLE (?default)
18
  IDENTIFIER (?default)
19
  CONSTANT (?default)
20
  OPERATOR (?default)
3
  # ELEMENT_NAME [optional-css-class] REGULAR_EXPRESSION
4
 
5
  NAME JavaScript
6
+ VERSION 1.1
7
 
8
  COMMENT (?default)
9
  STRING (?default)
10
 
11
  STATEMENT (?default)
12
+ RESERVED (?default)|\b(?<![:\.])(?-i:(?alt:reserved.txt))(?![:\.])\b
13
  TYPE (?default)
14
  MODIFIER (?default)
15
 
16
  ENTITY (?default)
17
+ VARIABLE (?default)|\b\s*[A-Za-z_]\w*\s*\:
18
  IDENTIFIER (?default)
19
  CONSTANT (?default)
20
  OPERATOR (?default)
langs/python/reserved.txt CHANGED
@@ -13,6 +13,7 @@ lambda
13
  print
14
  yield
15
  pass
 
16
  exec
17
  del
18
  def
13
  print
14
  yield
15
  pass
16
+ self
17
  exec
18
  del
19
  def
langs/sh/reserved.txt CHANGED
@@ -84,6 +84,7 @@ make
84
  mesg
85
  more
86
  nice
 
87
  qdel
88
  qmsg
89
  qrls
84
  mesg
85
  more
86
  nice
87
+ exit
88
  qdel
89
  qmsg
90
  qrls
readme.txt CHANGED
@@ -4,16 +4,53 @@ Donate link: http://ak.net84.net/
4
  Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter
5
  Requires at least: 3.0
6
  Tested up to: 3.3
7
- Stable tag: 1.3.5
8
 
9
- Syntax Highlighter supporting multiple languages, themes, highlighting from a URL, local file or post text.
10
 
11
  == Description ==
12
 
13
  A Syntax Highlighter built in PHP and jQuery that supports customizable languages and themes.
14
  It can highlight from a URL, a local file or Wordpress post text. Crayon makes it easy to manage Language files and define
15
  custom language elements with regular expressions.
16
- It also supports some neat features like mobile/touchscreen device detection, mouse interactions, toggled plain code, toggled line numbers, tab sizes, error logging and file extension detection just to name a few.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  Live Demo: <a href="http://bit.ly/poKNqs" target="_blank">http://bit.ly/poKNqs</a>
19
 
@@ -44,6 +81,17 @@ Contact me at http://twitter.com/crayonsyntax or crayon.syntax@gmail.com.
44
 
45
  == Changelog ==
46
 
 
 
 
 
 
 
 
 
 
 
 
47
  = 1.3.5 =
48
  * Removed some leftover code from popupWindow
49
 
4
  Tags: syntax highlighter, syntax, highlighter, highlighting, crayon, code highlighter
5
  Requires at least: 3.0
6
  Tested up to: 3.3
7
+ Stable tag: 1.4.0
8
 
9
+ Syntax Highlighter supporting multiple languages, themes, fonts, highlighting from a URL, local file or post text.
10
 
11
  == Description ==
12
 
13
  A Syntax Highlighter built in PHP and jQuery that supports customizable languages and themes.
14
  It can highlight from a URL, a local file or Wordpress post text. Crayon makes it easy to manage Language files and define
15
  custom language elements with regular expressions.
16
+ It also supports some neat features like:
17
+
18
+ * Mobile/touchscreen device detection
19
+ * Mouse event interaction (showing plain code on double click, toolbar on mouseover)
20
+ * Toggled plain code
21
+ * Toggled line numbers
22
+ * Copy/paste code
23
+ * Open code in a new window
24
+ * Tab sizes
25
+ * Code title
26
+ * Toggled toolbar
27
+ * Striped lines
28
+ * Line marking (for important lines)
29
+ * Starting line number (default is 1)
30
+ * Local directory to search for local files
31
+ * File extension detection
32
+ * Live Preview in settings
33
+ * Dimensions, margins, alignment and CSS floating
34
+ * Extensive error logging
35
+
36
+ == Supported Languages ==
37
+
38
+ Languages are defined in language files using Regular Expressions to capture elements.
39
+ See http://ak.net84.net/projects/crayon-language-file-specification/
40
+
41
+ * Default Langauge (one size fits all, highlights generic code)
42
+ * C
43
+ * C#
44
+ * C++
45
+ * CSS
46
+ * HTML (XML/XHTML)
47
+ * Java
48
+ * JavaScript
49
+ * Objective-C
50
+ * PHP
51
+ * Python
52
+ * Shell (Unix)
53
+ * Visual Basic
54
 
55
  Live Demo: <a href="http://bit.ly/poKNqs" target="_blank">http://bit.ly/poKNqs</a>
56
 
81
 
82
  == Changelog ==
83
 
84
+ = 1.4.0 =
85
+ * Added all other global settings for easy overriding: http://ak.net84.net/projects/crayon-settings/
86
+ * Fixed issues with variables and entites in language regex
87
+ * Added Epicgeeks theme made by Joe Newing of epicgeeks.net
88
+ * Help updated
89
+ * Fixed notice on missing jQuery string in settings
90
+ * Reduced number of setting reads
91
+ * Setting name cleanup
92
+ * Added a donate button, would appreciate any support offered and I hope you find Crayon useful
93
+ * String to boolean in util fixed
94
+
95
  = 1.3.5 =
96
  * Removed some leftover code from popupWindow
97
 
themes/epicgeeks/epicgeeks.css ADDED
@@ -0,0 +1,226 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ Theme Name: Epicgeeks
3
+ Description: Epicgeeks Cryaon Theme.
4
+ Version: 1.1
5
+ Author: J. Newing (synmuffin)
6
+ Author URI: http://epicgeeks.net/
7
+ */
8
+
9
+ .crayon-theme-epicgeeks {
10
+ border: 1px #e1e1e1 solid !important;
11
+ text-shadow: none !important;
12
+ background: #ffffe1 !important;
13
+ }
14
+
15
+ .crayon-theme-epicgeeks .crayon-nums {
16
+ background: #ffff9f !important;
17
+ color: #333333 !important;
18
+ border-right: 1px dashed #3cc0ff !important;
19
+ }
20
+
21
+ .crayon-theme-epicgeeks .crayon-code::selection,
22
+ .crayon-theme-epicgeeks .crayon-code *::selection {
23
+ background: #ddeeff !important;
24
+ color: #316ba5 !important;
25
+ }
26
+ .crayon-theme-epicgeeks::selection,
27
+ .crayon-theme-epicgeeks .crayon-toolbar::selection,
28
+ .crayon-theme-epicgeeks .crayon-toolbar *::selection,
29
+ .crayon-theme-epicgeeks .crayon-info::selection,
30
+ .crayon-theme-epicgeeks .crayon-info *::selection,
31
+ .crayon-theme-epicgeeks .crayon-nums::selection,
32
+ .crayon-theme-epicgeeks .crayon-nums *::selection {
33
+ background: transparent !important;
34
+ }
35
+
36
+ .crayon-theme-epicgeeks .crayon-striped-line {
37
+ background: #ffffd2 !important;
38
+ border: 1px dashed #f0f0f0;
39
+ }
40
+ .crayon-theme-epicgeeks .crayon-striped-line {
41
+ background: #ffffd2 !important;
42
+ border: 1px dashed #f0f0f0;
43
+ }
44
+ .crayon-theme-epicgeeks .crayon-striped-num {
45
+ background: #ffff7c !important;
46
+ border: 1px dashed #cccccc !important;
47
+ }
48
+
49
+ .crayon-theme-epicgeeks .crayon-marked-line {
50
+ background: #fffee2 !important;
51
+ border: 1px #e9e579 !important;
52
+ }
53
+
54
+ .crayon-theme-epicgeeks .crayon-marked-num {
55
+ color: #1561ac !important;
56
+ background: #f2f24b !important;
57
+ border: 1px #E9E579 !important;
58
+ }
59
+
60
+ .crayon-theme-epicgeeks .crayon-striped-line,
61
+ .crayon-theme-epicgeeks .crayon-striped-num {
62
+ border-left: none !important;
63
+ border-right: none !important;
64
+ }
65
+
66
+ .crayon-theme-epicgeeks .crayon-marked-line.crayon-striped-line {
67
+ background: #faf8d1 !important;
68
+ }
69
+
70
+ .crayon-theme-epicgeeks .crayon-marked-num.crayon-striped-num {
71
+ background: #dddd1c !important;
72
+ color: #105395 !important;
73
+ }
74
+
75
+ .crayon-theme-epicgeeks .crayon-marked-line.crayon-top,
76
+ .crayon-theme-epicgeeks .crayon-marked-num.crayon-top {
77
+ border-top-style: solid !important;
78
+ }
79
+
80
+ .crayon-theme-epicgeeks .crayon-marked-line.crayon-bottom,
81
+ .crayon-theme-epicgeeks .crayon-marked-num.crayon-bottom {
82
+ border-bottom-style: solid !important;
83
+ }
84
+
85
+ .crayon-theme-epicgeeks .crayon-info {
86
+ background: #faf9d7 !important;
87
+ border-bottom: 1px dashed #b1af5e !important;
88
+ color: #7e7d34;
89
+ }
90
+
91
+ .crayon-theme-epicgeeks .crayon-toolbar {
92
+ background: #f9f9f9 !important;
93
+ border-bottom: 1px solid #d2d2d2 !important;
94
+ }
95
+
96
+ .crayon-theme-epicgeeks .crayon-toolbar > div {
97
+ float: left !important;
98
+ }
99
+
100
+ .crayon-theme-epicgeeks .crayon-toolbar .crayon-tools {
101
+ float: right !important;
102
+ }
103
+
104
+ .crayon-theme-epicgeeks .crayon-title {
105
+ color: #333333 !important;
106
+ }
107
+
108
+ .crayon-theme-epicgeeks .crayon-language {
109
+ color: #999999 !important;
110
+ }
111
+ .crayon-theme-epicgeeks a.crayon-button:link {
112
+ color: #666666 !important;
113
+ }
114
+
115
+ .crayon-theme-epicgeeks a.crayon-button:hover,
116
+ .crayon-theme-epicgeeks a.crayon-button.crayon-pressed {
117
+ color: #ffffff !important;
118
+ }
119
+
120
+ .crayon-theme-epicgeeks a.crayon-button:active {
121
+ color: #666666 !important;
122
+ }
123
+
124
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button:link {
125
+ background: url('images/code.gif') no-repeat 0px -16px;
126
+ }
127
+
128
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button:hover,
129
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button.crayon-pressed {
130
+ background-position: 0px 0px;
131
+ }
132
+
133
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-plain-button:active {
134
+ background-position: 0px 0px;
135
+ }
136
+
137
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-copy-button:link {
138
+ background: url('images/copy.gif') no-repeat 0px -16px;
139
+ }
140
+
141
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-copy-button:hover,
142
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-copy-button.crayon-pressed {
143
+ background-position: 0px 0px;
144
+ }
145
+
146
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-copy-button:active {
147
+ background-position: 0px 0px;
148
+ }
149
+
150
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-popup-button:link {
151
+ background: url('images/pop.gif') no-repeat 0px -16px;
152
+ }
153
+
154
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-popup-button:hover,
155
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-popup-button.crayon-pressed {
156
+ background-position: 0px 0px;
157
+ }
158
+
159
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-popup-button:active {
160
+ background-position: 0px 0px;
161
+ }
162
+
163
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button:link {
164
+ background: url('images/list.gif') no-repeat 0px -16px;
165
+ }
166
+
167
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button:hover,
168
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button.crayon-pressed {
169
+ background-position: 0px 0px;
170
+ }
171
+
172
+ .crayon-syntax .crayon-toolbar a.crayon-button.crayon-nums-button:active {
173
+ background-position: 0px 0px;
174
+ }
175
+
176
+ .crayon-syntax .crayon-title {
177
+ float: left;
178
+ }
179
+
180
+ .crayon-theme-epicgeeks .crayon-pre .c {
181
+ color: #787878 !important;
182
+ }
183
+ .crayon-theme-epicgeeks .crayon-pre .s {
184
+ color: #90c300 !important;
185
+ }
186
+ .crayon-theme-epicgeeks .crayon-pre .k,
187
+ .crayon-theme-epicgeeks .crayon-pre .st,
188
+ .crayon-theme-epicgeeks .crayon-pre .r,
189
+ .crayon-theme-epicgeeks .crayon-pre .t,
190
+ .crayon-theme-epicgeeks .crayon-pre .m {
191
+ color: #ff00aa !important;
192
+ }
193
+
194
+ .crayon-theme-epicgeeks .crayon-pre .i {
195
+ color: #878787 !important;
196
+ }
197
+
198
+ .crayon-theme-epicgeeks .crayon-pre .v {
199
+ color: #ca00ff !important;
200
+ }
201
+
202
+ .crayon-theme-epicgeeks .crayon-pre .e {
203
+ color: #00d5ff !important;
204
+ }
205
+
206
+ .crayon-theme-epicgeeks .crayon-pre .cn {
207
+ color: #e87b7b !important;
208
+ }
209
+
210
+ .crayon-theme-epicgeeks .crayon-pre .o,
211
+ .crayon-theme-epicgeeks .crayon-pre .h {
212
+ color: #006fe0 !important;
213
+ }
214
+
215
+ .crayon-theme-epicgeeks .crayon-pre .sy {
216
+ color: #3c3c3c !important;
217
+ }
218
+
219
+ .crayon-theme-epicgeeks .crayon-pre .n {
220
+ color: #b7b7b7 !important;
221
+ font-style: italic;
222
+ }
223
+
224
+ .crayon-theme-epicgeeks .crayon-pre .f {
225
+ color: #cfcfcf !important;
226
+ }
themes/epicgeeks/images/code.gif ADDED
Binary file
themes/epicgeeks/images/copy.gif ADDED
Binary file
themes/epicgeeks/images/list.gif ADDED
Binary file
themes/epicgeeks/images/pop.gif ADDED
Binary file
util/crayon_util.class.php CHANGED
@@ -340,10 +340,10 @@ class CrayonUtil {
340
  return $bool ? 'Yes' : 'No';
341
  }
342
 
343
- // String to boolean, default decides what boolean value to look for
344
  public static function str_to_bool($str, $default = TRUE) {
345
- $str = trim(strtolower($str));
346
- if ($default) {
347
  if ($str == 'true' || $str == 'yes' || $str == '1') {
348
  return TRUE;
349
  } else {
@@ -358,6 +358,10 @@ class CrayonUtil {
358
  }
359
 
360
  }
 
 
 
 
361
 
362
  // Escapes $ and \ from the replacement to avoid becoming a backreference
363
  public static function preg_replace_escape_back($pattern, $replacement, $subject, $limit=-1, &$count=0) {
340
  return $bool ? 'Yes' : 'No';
341
  }
342
 
343
+ // String to boolean, default decides what boolean value to return when not found
344
  public static function str_to_bool($str, $default = TRUE) {
345
+ $str = self::tlower($str);
346
+ if ($default === FALSE) {
347
  if ($str == 'true' || $str == 'yes' || $str == '1') {
348
  return TRUE;
349
  } else {
358
  }
359
 
360
  }
361
+
362
+ public static function tlower($str) {
363
+ return trim(strtolower($str));
364
+ }
365
 
366
  // Escapes $ and \ from the replacement to avoid becoming a backreference
367
  public static function preg_replace_escape_back($pattern, $replacement, $subject, $limit=-1, &$count=0) {
util/help.htm CHANGED
@@ -29,50 +29,182 @@
29
  <td width="30%"><code>mark="5-10,12"</code></td>
30
  </tr>
31
  </table>
32
- <p>Crayon is versatile so you can override global settings for individual Crayons with attributes. Here are some examples:</p>
33
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="crayon-table crayon-table-light">
34
- <tr class="crayon-table-header" >
35
- <td width="20">Setting</td>
36
- <td width="60%">Description</td>
37
- <td width="30%">Example</td>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  </tr>
39
  <tr>
40
- <td width="20">theme</td>
41
- <td width="60%">Specify a Theme ID, these are the folders in the '\themes' directory.</td>
42
- <td width="30%"><code>theme=&quot;twilight&quot;</code></td>
43
  </tr>
44
  <tr>
45
- <td width="20">height</td>
46
- <td width="60%">Set the height just like a css property, using 'height', 'max-height' or 'min-height'. You can also specify pixels or percentage, otherwise it will use global settings.</td>
47
- <td width="30%"><code>min-height=&quot;100px&quot;</code><br />
48
- <code>width=&quot;50%&quot;</code></td>
49
  </tr>
50
  <tr>
51
- <td width="20">toolbar-hide</td>
52
- <td width="60%">Show/hide the toolbar and controls.</td>
53
- <td width="30%"><code>toolbar-hide=&quot;true&quot;</code><br />
54
- <code>toolbar-hide=&quot;false&quot;</code></td>
55
  </tr>
56
  <tr>
57
- <td width="20">nums</td>
58
- <td width="60%">Show/hide line numbers.</td>
59
- <td width="30%"><code>nums=&quot;false&quot;</code></td>
60
  </tr>
61
  <tr>
62
- <td width="20">font-size</td>
63
- <td width="60%">Set the font size in pixels.</td>
64
- <td width="30%"><code>font-size=&quot;20&quot;</code></td>
65
  </tr>
66
  <tr>
67
- <td width="20">start-line</td>
68
- <td width="60%">Set the starting line number.</td>
69
- <td width="30%"><code>start-line=&quot;184&quot;</code></td>
70
  </tr>
71
  </table>
72
- <p>Here's a simple example of attributes:</p>
73
- <p><code>
74
- [crayon lang="html" font-size="20" mark="1" width="200px"] &lt;strong&gt;This is great!&lt;/strong&gt; [/crayon] </code></p>
75
- <p>These are just a few examples. See the <a href="http://ak.net84.net/?go=crayondocs" target="_blank">online documentation</a> for the complete list and their uses. If you want to prevent the <code>[crayon]</code> shortcode from turning into a Crayon, use: <code>$[crayon]...[/crayon]$</code></p>
76
  <p><strong>Themes</strong></p>
77
  <p>Crayon comes with built-in Themes to style your code. You can learn how to create your own and download more from <a href="http://ak.net84.net/?go=crayonthemes" target="_blank">here</a>. Themes are structured <code>/themes/theme-name/theme-name.css</code>. If you know CSS, take a look at <code>/themes/default/default.css</code> to get an idea of how they work and how you can change/create them.</p>
78
  <p><strong>Languages</strong></p>
29
  <td width="30%"><code>mark="5-10,12"</code></td>
30
  </tr>
31
  </table>
32
+ <p>Crayon is versatile so you can override global settings for individual Crayons with attributes.</p>
33
  <table width="100%" border="0" cellpadding="0" cellspacing="0" class="crayon-table crayon-table-light">
34
+ <tr class="crayon-table-header">
35
+ <td width="151"><strong>Setting</strong></td>
36
+ <td width="160"><strong>Allowed Value</strong></td>
37
+ <td width="65"><strong>Description</strong></td>
38
+ </tr>
39
+ <tr>
40
+ <td> theme</td>
41
+ <td>string</td>
42
+ <td>ID of the theme to use</td>
43
+ </tr>
44
+ <tr>
45
+ <td> font</td>
46
+ <td>string</td>
47
+ <td>ID of the font to use</td>
48
+ </tr>
49
+ <tr>
50
+ <td> font-size</td>
51
+ <td>number &gt; 0</td>
52
+ <td> Custom font size in pixels</td>
53
+ </tr>
54
+ <tr>
55
+ <td> min-height/max-height</td>
56
+ <td>number &gt; 0 followed by px/%</td>
57
+ <td>Minimum/maximum height in units</td>
58
+ </tr>
59
+ <tr>
60
+ <td>height</td>
61
+ <td>number &gt; 0 followed by px/%</td>
62
+ <td>Height in units</td>
63
+ </tr>
64
+ <tr>
65
+ <td> min-width/max-width</td>
66
+ <td>number &gt; 0 followed by px/%</td>
67
+ <td>Minimum/maximum width in units</td>
68
+ </tr>
69
+ <tr>
70
+ <td>width</td>
71
+ <td>number &gt; 0 followed by px/%</td>
72
+ <td>Width in units</td>
73
+ </tr>
74
+ <tr>
75
+ <td>toolbar</td>
76
+ <td>true/false/&quot;always&quot;</td>
77
+ <td>Show or hide the toolbar. &quot;always&quot; shows always (without mouseover).</td>
78
+ </tr>
79
+ <tr>
80
+ <td> top-margin</td>
81
+ <td>number &gt;= 0</td>
82
+ <td>Top margin in pixels</td>
83
+ </tr>
84
+ <tr>
85
+ <td> bottom-margin</td>
86
+ <td>number &gt;= 0</td>
87
+ <td>Bottom margin in pixels</td>
88
+ </tr>
89
+ <tr>
90
+ <td> left-margin</td>
91
+ <td>number &gt;= 0</td>
92
+ <td>Left margin in pixels</td>
93
+ </tr>
94
+ <tr>
95
+ <td> right-margin</td>
96
+ <td>number &gt;= 0</td>
97
+ <td>Right margin in pixels</td>
98
+ </tr>
99
+ <tr>
100
+ <td> h-align</td>
101
+ <td>&quot;none/left/right/center&quot;</td>
102
+ <td>Horizontal alignment</td>
103
+ </tr>
104
+ <tr>
105
+ <td> float-enable</td>
106
+ <td>true/false</td>
107
+ <td> Allow floating elements to surround Crayon</td>
108
+ </tr>
109
+ <tr>
110
+ <td>toolbar-overlay</td>
111
+ <td>true/false</td>
112
+ <td>Overlay the toolbar on code rather than push it down when possible</td>
113
+ </tr>
114
+ <tr>
115
+ <td>toolbar-hide</td>
116
+ <td>true/false</td>
117
+ <td>Toggle the toolbar on single click when it is overlayed</td>
118
+ </tr>
119
+ <tr>
120
+ <td>toolbar-delay</td>
121
+ <td>true/false</td>
122
+ <td>Delay hiding the toolbar on MouseOut</td>
123
+ </tr>
124
+ <tr>
125
+ <td>show-title</td>
126
+ <td>true/false</td>
127
+ <td>Display the title when provided</td>
128
+ </tr>
129
+ <tr>
130
+ <td>show-lang</td>
131
+ <td>&quot;found/always/never&quot;</td>
132
+ <td>When to display the language.</td>
133
+ </tr>
134
+ <tr>
135
+ <td>striped</td>
136
+ <td>true/false</td>
137
+ <td>Display striped code lines</td>
138
+ </tr>
139
+ <tr>
140
+ <td>marking</td>
141
+ <td>true/false</td>
142
+ <td>Enable line marking for important lines</td>
143
+ </tr>
144
+ <tr>
145
+ <td>nums</td>
146
+ <td>true/false</td>
147
+ <td>Display line numbers by default</td>
148
+ </tr>
149
+ <tr>
150
+ <td>nums-toggle</td>
151
+ <td>true/false</td>
152
+ <td>Enable line number toggling</td>
153
+ </tr>
154
+ <tr>
155
+ <td>start-line</td>
156
+ <td>number &gt;= 0</td>
157
+ <td>When to start line numbers from</td>
158
+ </tr>
159
+ <tr>
160
+ <td>fallback-lang</td>
161
+ <td>string</td>
162
+ <td>ID of the language to use when none is detected</td>
163
+ </tr>
164
+ <tr>
165
+ <td>local-path</td>
166
+ <td>string</td>
167
+ <td>Local path to load file from</td>
168
+ </tr>
169
+ <tr>
170
+ <td> touchscreen</td>
171
+ <td>true/false</td>
172
+ <td> Disable mouse gestures for touchscreen devices (eg. MouseOver)</td>
173
  </tr>
174
  <tr>
175
+ <td> disable-anim</td>
176
+ <td>true/false</td>
177
+ <td>Disable animations</td>
178
  </tr>
179
  <tr>
180
+ <td> runtime</td>
181
+ <td>true/false</td>
182
+ <td> Disable runtime stats</td>
 
183
  </tr>
184
  <tr>
185
+ <td> error-log</td>
186
+ <td>true/false</td>
187
+ <td> Log errors for individual Crayons</td>
 
188
  </tr>
189
  <tr>
190
+ <td> error-log-sys</td>
191
+ <td>true/false</td>
192
+ <td> Log system-wide errors</td>
193
  </tr>
194
  <tr>
195
+ <td> error-msg-show</td>
196
+ <td>true/false</td>
197
+ <td> Display custom message for errors</td>
198
  </tr>
199
  <tr>
200
+ <td> error-msg</td>
201
+ <td>string</td>
202
+ <td> The error message to show for errors</td>
203
  </tr>
204
  </table>
205
+ <p>Here's a simple example of attributes:</p><p><code>
206
+ [crayon lang="html" font-size="20" mark="1" width="200px" toolbar=&quot;false&quot;] &lt;strong&gt;This is great!&lt;/strong&gt; [/crayon] </code></p>
207
+ <p>If you want to prevent the <code>[crayon]</code> shortcode from turning into a Crayon, use: <code>$[crayon]...[/crayon]$</code></p>
 
208
  <p><strong>Themes</strong></p>
209
  <p>Crayon comes with built-in Themes to style your code. You can learn how to create your own and download more from <a href="http://ak.net84.net/?go=crayonthemes" target="_blank">here</a>. Themes are structured <code>/themes/theme-name/theme-name.css</code>. If you know CSS, take a look at <code>/themes/default/default.css</code> to get an idea of how they work and how you can change/create them.</p>
210
  <p><strong>Languages</strong></p>