1
0
mirror of https://github.com/themsaid/ibis.git synced 2025-01-16 21:18:35 +01:00

upgrade to new render for commonmark

This commit is contained in:
Roberto Butti 2022-11-27 19:31:49 +01:00
parent cd4130b082
commit 34af9d76b4
3 changed files with 12 additions and 6 deletions

View File

@ -21,9 +21,9 @@
"require": { "require": {
"illuminate/filesystem": "^7.0|^8.0", "illuminate/filesystem": "^7.0|^8.0",
"illuminate/support": "^7.0|^8.0|^9.0", "illuminate/support": "^7.0|^8.0|^9.0",
"symfony/console": "^4.2|^5.0|^6.0",
"mpdf/mpdf": "^8.1", "mpdf/mpdf": "^8.1",
"spatie/commonmark-highlighter": "^2.1|^3.0" "spatie/commonmark-highlighter": "^2.1|^3.0",
"symfony/console": "^4.2|^5.0|^6.0"
}, },
"require-dev": { "require-dev": {
"laravel/pint": "^1.2", "laravel/pint": "^1.2",

2
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "82f563307e9fa59fa8360846882687e6", "content-hash": "8fd9ff4af82026c376f46e05a4e70d2b",
"packages": [ "packages": [
{ {
"name": "dflydev/dot-access-data", "name": "dflydev/dot-access-data",

View File

@ -7,7 +7,8 @@ use Mpdf\Mpdf;
use SplFileInfo; use SplFileInfo;
use Mpdf\Config\FontVariables; use Mpdf\Config\FontVariables;
use Mpdf\Config\ConfigVariables; use Mpdf\Config\ConfigVariables;
use League\CommonMark\Environment; use League\CommonMark\Environment\Environment;
use Illuminate\Filesystem\Filesystem; use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Command\Command;
use League\CommonMark\Block\Element\FencedCode; use League\CommonMark\Block\Element\FencedCode;
@ -64,8 +65,13 @@ class BuildCommand extends Command
$this->themeName = $input->getArgument('theme'); $this->themeName = $input->getArgument('theme');
$currentPath = getcwd(); $currentPath = getcwd();
$config = require $currentPath.'/ibis.php'; $configIbisFile = $currentPath . '/ibis.php';
if (!$this->disk->isFile($configIbisFile)) {
$this->output->writeln('<error>Error, check if ' . $configIbisFile . ' exists.</error>');
exit - 1;
}
$config = require $configIbisFile;
$this->ensureExportDirectoryExists( $this->ensureExportDirectoryExists(
$currentPath = getcwd() $currentPath = getcwd()
); );
@ -113,7 +119,7 @@ class BuildCommand extends Command
$environment = Environment::createCommonMarkEnvironment(); $environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new TableExtension()); $environment->addExtension(new TableExtension());
$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer([ $environment->addRenderer(FencedCode::class, new FencedCodeRenderer([
'html', 'php', 'js', 'bash', 'json' 'html', 'php', 'js', 'bash', 'json'
])); ]));