use Cubist\Util\CommandLine;
use Cubist\Util\Files\Files;
+use Cubist\Util\Markdown;
class Docling extends CommandLine
{
if ($locale) {
$cli->setArg('ocr-lang', $locale);
}
+ $cli->setArg('ocr-engine', 'easyocr');
$cli->setArg('output', $tmp);
$cli->setArg(null, $image);
$cli->execute();
- $md = $tmp . '/' . $f->getBasename('.md');
+ $md = file_get_contents($tmp . '/' . $f->getBasename('.' . $f->getExtension()) . '.md');
+
+ $html = Markdown::toHTML($md, false);
+ file_put_contents($out, $html);
+ return $html;
}
return file_get_contents($out);
}