Exemple #1
0
No Parse:[nl][noparse]
    [code=php]this is a code block[/code][nl]-newline[p]paragraph[/p]
[/noparse][nl][nl]

[code=cpp]#include <iostream>

using namespace std;

int main()
{
    cout << \\"Hello World!\\";
    cin.get();

    return 0;
}[/code]
Youtube Video: [youtube url=https://www.youtube.com/watch?v=g4rYh3e97VU][nl]

HTML5 Video:[nl][video src=http://cdn.kalebklein.com/kparser/video.mp4][nl]

HTML5 Video with controls:[nl][video src=http://cdn.kalebklein.com/kparser/video.mp4 controls][nl]

HTML5 Video with width & height size:[nl][video src=http://cdn.kalebklein.com/kparser/video.mp4 controls size=500x400][nl]

HTML5 Video with global size:[nl][video src=http://cdn.kalebklein.com/kparser/video.mp4 size=500][nl]

[hr type=hrclass]
<h2>Emoticons</h2>
EOF;
$parser = new KParser();
echo $parser->parse($text);
Exemple #2
0
 public function testParse()
 {
     $parser = new KParser();
     $this->assertTrue($parser->parse('Testing parsing method') !== '');
 }
Exemple #3
0
<?php

require __DIR__ . '/../../vendor/autoload.php';
// Require the autoloading file from Composer
use Pazuzu156\KParser\KParser;
// Use the KParser class from the Pazuzu156\KParser package
$parser = new KParser();
$emotearray = [':angry:', ':arrow:', ':bigsmile:', ':blink:', ':cool:', ':dunno:', ':!:', ':omg:', ':laugh:', ':ohmy:', ':ninja:', ':puke:', ':??:', ':we:', ':frown:', ':smile:', ':tongue:', ':123:', ':wink:'];
echo "<tr>\n";
foreach ($emotearray as $emote) {
    echo "<th style='border: 1px inset #000;'>\n\t" . $emote . "\n</th>\n";
}
echo "</tr>\n<tr>\n";
foreach ($emotearray as $emote) {
    echo "<td style='border: 1px inset #000;'>\n\t" . $parser->parse($emote, true) . "\n</td>" . "\n";
}
echo "</tr>\n";
?>
</table>
<br><br>
Exemple #4
0
<?php

require __DIR__ . '/../../vendor/autoload.php';
// Require the autoloading file from Composer
use Pazuzu156\KParser\KParser;
// Use the KParser class from the Pazuzu156\KParser package
$content = <<<'EOF'
[hr type=hrclass]
<h2>Terminal</h2>
Terminal Output:[nl]
[terminal user=root host=kalebklein.com]
[command]ls -l[/command]
[command]clear[/command]
[command]which sh[/command]
[response]/usr/bin/sh[/response]
[/terminal]
[p]Supported themes:
[ol]
[li]Default ^ The one you see here[/li]
[li]KParser[/li]
[li]Solarized[/li]
[li]Solarized Dark[/li]
[li]Coffee[/li]
[li]Monokai[/li]
[li]Predawn[/li]
[li]Bluebird[/li]
[/ol]
You can view the different themes supported by the Terminal widget by using the [url=http://testsites.kalebklein.com/terminal/ newtab]KParser Terminal Style Tester Tool[/url][/p]
EOF;
$parser = new KParser();
echo $parser->parse($content);