• Reading time ~ 1 min
  • 24.08.2022

Laravel Markdown is a highly configurable markdown renderer and Blade component for Laravel by the folks at Spatie:

— Freek Van der Herten 🔭 (@freekmurze) July 13, 2021

The package features a blade component that can render Markdown in blade templates, for example:

<x-markdown>
# My title
This is a [link to our website](https://spatie.be)
```php
echo 'Hello world';
```
</x-markdown>

Would be converted to the following HTML:

<div>
    <h1 id="my-title">My title</h1>
    <p>This is a <a href="https://spatie.be">link to our website</a></p>
    <pre class="shiki" style="background-color: #fff"><code><span class="line"><span
        style="color: #005CC5">echo</span><span style="color: #24292E"> </span><span style="color: #032F62">&#39;Hello world&#39;</span><span
        style="color: #24292E">;</span></span>
<span class="line"></span></code></pre>
</div>

In addition to rendering markdown, this package helps you set up syntax highlighting (using Shiki via Shiki PHP) and is highly configurable. Some interesting configuration options include automatically adding anchor links to headers, toggling code highlighting, and configuring the theme used for syntax highlighting.

Check out the markdown.php configuration file for further details on all the configuration options available for this package.

You can learn more about this package, get full installation instructions, and view the source code on GitHub.

Comments

No comments yet
Yurij Finiv

Yurij Finiv

Full stack

ABOUT

Professional Fullstack Developer with extensive experience in website and desktop application development. Proficient in a wide range of tools and technologies, including Bootstrap, Tailwind, HTML5, CSS3, PUG, JavaScript, Alpine.js, jQuery, PHP, MODX, and Node.js. Skilled in website development using Symfony, MODX, and Laravel. Experience: Contributed to the development and translation of MODX3 i...

About author CrazyBoy49z
WORK EXPERIENCE
Contact
Ukraine, Lutsk
+380979856297