You can install the package via composer:
composer require spatie/laravel-markdown
To enable the code highlighting feature, you'll need to install the JavaScript package shiki
in your project. You can install it via npm...
npm install shiki
... or Yarn.
yarn add shiki
Make sure you have installed Node 10 or higher.
Optionally, You can publish the config file with:
php artisan vendor:publish --provider="Spatie\LaravelMarkdown\MarkdownServiceProvider" --tag="markdown-config"
This is the contents of the published config file:
return [
'code_highlighting' => [
'enabled' => true,
'theme' => 'github-light',
],
'add_anchors_to_headings' => true,
'commonmark_options' => [],
'cache_store' => null,
'renderer_class' => Spatie\LaravelMarkdown\MarkdownRenderer::class,
'extensions' => [
],
'block_renderers' => [
],
'inline_renderers' => [
],
'inline_parsers' => [
],
];