for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Koriym\AppStateDiagram;
use Michelf\MarkdownExtra;
final class MdToHtml
{
public function __invoke(string $title, string $markdown): string
$htmlDiv = MarkdownExtra::defaultTransform($markdown);
return /** @lang HTML */<<<EOT
<html lang="en">
<head>
<title>{$title}</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/3.0.1/github-markdown.min.css">
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 25px;
}
@media (max-width: 767px) {
padding: 15px;
</style>
</head>
<body>
<div class="markdown-body">
{$htmlDiv}
</div>
</body>
</html>
EOT;