Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CommonMark Renderer #705

Merged
merged 1 commit into from
May 16, 2024
Merged

CommonMark Renderer #705

merged 1 commit into from
May 16, 2024

Conversation

scottcharlesworth
Copy link
Contributor

Allows renderers to be defined in the config.php file, which are then passed to the league/commonmark package.

This means packages like spatie/commonmark-highlighter can be used.

// config.php Example
<?php

return [
    'production' => false,
    'baseUrl' => '',
    'title' => 'Jigsaw',
    'description' => 'Website description.',
    'collections' => [],
    'commonmark' => [
        'renderers' => [
            \League\CommonMark\Extension\CommonMark\Node\Block\FencedCode::class => new \Spatie\CommonMarkHighlighter\FencedCodeRenderer,
            \League\CommonMark\Extension\CommonMark\Node\Block\IndentedCode::class => new \Spatie\CommonMarkHighlighter\IndentedCodeRenderer,
        ],
    ],
];

@damiani
Copy link
Contributor

damiani commented May 16, 2024

Love it, thanks @scottcharlesworth!

@damiani damiani merged commit 6a79185 into tighten:main May 16, 2024
4 of 5 checks passed
@scottcharlesworth scottcharlesworth deleted the commonmark-renderers branch May 16, 2024 22:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants