1. Go to this page and download the library: Download ryangjchandler/phiki library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ryangjchandler / phiki example snippets
use Phiki\Phiki;
use Phiki\Grammar\Grammar;
use Phiki\Theme\Theme;
$phiki = new Phiki();
$html = $phiki->codeToHtml(
<<<'PHP'
echo "Hello, world!";
PHP,
Grammar::Php,
Theme::GithubDark,
);
use League\CommonMark\Environment\Environment;
use League\CommonMark\Extension\CommonMark\CommonMarkCoreExtension;
use League\CommonMark\MarkdownConverter;
use Phiki\CommonMark\PhikiExtension;
$environment = new Environment;
$environment
->addExtension(new CommonMarkCoreExtension)
->addExtension(new PhikiExtension('github-dark'));
$converter = new MarkdownConverter($environment);
$output = $converter->convert(<<<'MD'