You are here

function _syntaxhighlighter_filter_tips in Syntax Highlighter 8

Same name and namespace in other branches
  1. 7.2 syntaxhighlighter.module \_syntaxhighlighter_filter_tips()
  2. 7 syntaxhighlighter.module \_syntaxhighlighter_filter_tips()

Show usage tips for the syntaxhighlighter filter.

2 calls to _syntaxhighlighter_filter_tips()
FilterSyntaxHighlighter::tips in src/Plugin/Filter/FilterSyntaxHighlighter.php
Generates a filter's tip.
syntaxhighlighter_help in ./syntaxhighlighter.module
Implements hook_help().

File

./syntaxhighlighter.module, line 225
Syntax highlight code using the SyntaxHighlighter Javascript library.

Code

function _syntaxhighlighter_filter_tips($filter, $format, $long = FALSE) {
  $config = \Drupal::config('syntaxhighlighter.settings');
  $tag_name = $config
    ->get('tagname');
  $tip = t('Syntax highlight code surrounded by the <code>@ex0</code> tags, where @lang is one of the following language brushes: %brushes.', [
    '@ex0' => "<{$tag_name} class=\"brush: LANG\">...</{$tag_name}>",
    '@lang' => "LANG",
    '%brushes' => implode(', ', _syntaxhighlighter_get_enabled_language_brushes()),
  ]);
  if ($long) {
    $tip .= '<br/>' . t('See <a href=":url0">the SyntaxHighlighter javascript library site</a> for additional help.', [
      ':url0' => 'http://alexgorbatchev.com/SyntaxHighlighter/',
    ]);
  }
  return $tip;
}