This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
More...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.
ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.
If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Syntax highlighter wrapper class
- Author
- Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Definition at line 24 of file class.ilSyntaxHighlighter.php.
◆ __construct()
| ilSyntaxHighlighter::__construct |
( |
string |
$a_lang | ) |
|
|
protected |
◆ getInstance()
| static ilSyntaxHighlighter::getInstance |
( |
string |
$a_lang | ) |
|
|
static |
◆ getNewLanguageId()
| static ilSyntaxHighlighter::getNewLanguageId |
( |
string |
$a_old_lang_id | ) |
|
|
static |
Get new language id (for an old one)
Definition at line 91 of file class.ilSyntaxHighlighter.php.
91 : string
92 {
93 return self::$v51_map[$a_old_lang_id] ?? $a_old_lang_id;
94 }
◆ getSupportedLanguages()
| static ilSyntaxHighlighter::getSupportedLanguages |
( |
| ) |
|
|
static |
◆ getSupportedLanguagesV51()
| static ilSyntaxHighlighter::getSupportedLanguagesV51 |
( |
| ) |
|
|
static |
◆ highlight()
| ilSyntaxHighlighter::highlight |
( |
string |
$a_code | ) |
|
Definition at line 113 of file class.ilSyntaxHighlighter.php.
113 : string
114 {
115 include_once("./libs/composer/vendor/geshi/geshi/src/geshi.php");
116 $geshi = new Geshi(html_entity_decode($a_code), $this->lang);
117
118
119
120
121 $a_code = $geshi->parse_code();
122
123
124 $a_code = substr($a_code, strpos($a_code, ">") + 1);
125 $a_code = substr($a_code, 0, strrpos($a_code, "<"));
126
127 return $a_code;
128 }
◆ isSupported()
| static ilSyntaxHighlighter::isSupported |
( |
string |
$a_lang | ) |
|
|
static |
◆ $lang
| string ilSyntaxHighlighter::$lang |
|
protected |
◆ $langs
| array ilSyntaxHighlighter::$langs |
|
staticprotected |
◆ $v51_map
| array ilSyntaxHighlighter::$v51_map |
|
staticprotected |
| const ilSyntaxHighlighter::C = "c" |
◆ CPP
| const ilSyntaxHighlighter::CPP = "cpp" |
◆ DELPHI
| const ilSyntaxHighlighter::DELPHI = "delphi" |
◆ HTML
| const ilSyntaxHighlighter::HTML = "html4strict" |
◆ JAVA
| const ilSyntaxHighlighter::JAVA = "java" |
◆ LATEX
| const ilSyntaxHighlighter::LATEX = "latex" |
◆ PHP
| const ilSyntaxHighlighter::PHP = "php" |
◆ VISUAL_BASIC
| const ilSyntaxHighlighter::VISUAL_BASIC = "vb" |
◆ XML
| const ilSyntaxHighlighter::XML = "xml" |
The documentation for this class was generated from the following file: