Inject the renderer anywhere via autowiring and call render():
use MarkupCarve\SymfonyCarve\CarveRenderer;
public function show(CarveRenderer $carve): Response
{
$html = $carve->render('# Hello *world*');
return new Response($html);
}
# Welcome to Carve
This is a paragraph with /italic/, *bold*, and _underline_ text.
## Features
- Clean, consistent syntax
- [x] Task lists work
- [ ] Even unchecked ones
> Carve is a lightweight markup language for structured documents, with clear, consistent syntax.
### Code
``` php
$html = (new CarveConverter())->convert('Hello *world*');
```
Visit [the spec](https://github.com/markup-carve/carve) for the details.
<section id="Welcome-to-Carve">
<h1>Welcome to Carve</h1>
<p>This is a paragraph with <em>italic</em>, <strong>bold</strong>, and <u>underline</u> text.</p>
<section id="Features">
<h2>Features</h2>
<ul>
<li>Clean, consistent syntax</li>
</ul>
<ul>
<li><input type="checkbox" checked disabled aria-label="Task lists work"> Task lists work</li>
<li><input type="checkbox" disabled aria-label="Even unchecked ones"> Even unchecked ones</li>
</ul>
<blockquote><p>Carve is a lightweight markup language for structured documents, with clear, consistent syntax.</p></blockquote>
<section id="Code">
<h3>Code</h3>
<pre><code class="language-php">$html = (new CarveConverter())->convert('Hello *world*');
</code></pre>
<p>Visit <a href="https://github.com/markup-carve/carve">the spec</a> for the details.</p>
</section>
</section>
</section>
This is a paragraph with italic, bold, and underline text.
Carve is a lightweight markup language for structured documents, with clear, consistent syntax.
$html = (new CarveConverter())->convert('Hello *world*');
Visit the spec for the details.