You are here

function syntaxhighlighter_filter_tips in Syntax Highlighter 6

Same name and namespace in other branches
  1. 6.2 syntaxhighlighter.module \syntaxhighlighter_filter_tips()
2 calls to syntaxhighlighter_filter_tips()
syntaxhighlighter_filter in ./syntaxhighlighter.module
Implements hook_filter()
syntaxhighlighter_help in ./syntaxhighlighter.module

File

./syntaxhighlighter.module, line 134
Syntax highlight code using the Syntaxhighlighter javascript library. See http://alexgorbatchev.com/wiki/SyntaxHighlighter

Code

function syntaxhighlighter_filter_tips($delta, $format, $long = FALSE) {
  if ($long) {
    $tip[] = '<p>' . t('Syntax highlight code surrounded by the <code>!ex0</code> tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".', array(
      '!ex0' => '{syntaxhighlighter SPEC}...{/syntaxhighlighter}',
    )) . '</p>';
    $tip[] = '<p>' . t('Example: <code>!ex1</code>', array(
      '!ex1' => '{syntaxhighlighter brush:php;collapse:true;first-line:50;highlight:[57,81,101];class-name:\'some_class some_other_class\'}...{/syntaxhighlighter}',
    )) . '</p>';
    $tip[] = '<p>' . t('This will syntax highlight PHP code, initially collapsed, start line number at 50, highlight lines 57, 81 and 101 and tag highlighted code with class names some_class and some_other_class.');
    $tip[] = '<p>' . t('See <a href="!url0">the Syntaxhighlighter javascript library site</a> for additional helps.', array(
      '!url0' => 'http://alexgorbatchev.com/',
    )) . '</p>';
    $tip = implode("\n", $tip);
  }
  else {
    $tip = t('Syntax highlight code surrounded by the <code>!ex0</code> tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".', array(
      '!ex0' => '{syntaxhighlighter SPEC}...{/syntaxhighlighter}',
    ));
  }
  return $tip;
}