Skip to content

Commit

Permalink
Allow Commonmark to be extended.
Browse files Browse the repository at this point in the history
  • Loading branch information
aarondfrancis committed Jul 30, 2021
1 parent 92a26b5 commit c8f4fbe
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Commands/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function execute(InputInterface $input, OutputInterface $output)
$theme = $this->getTheme($currentPath, $this->themeName);

$this->buildPdf(
$this->buildHtml($currentPath.'/content'),
$this->buildHtml($currentPath.'/content', $config),
$config,
$currentPath,
$theme
Expand Down Expand Up @@ -103,9 +103,10 @@ protected function ensureExportDirectoryExists(string $currentPath): void

/**
* @param string $path
* @param array $config
* @return string
*/
protected function buildHtml(string $path)
protected function buildHtml(string $path, array $config)
{
$this->output->writeln('<fg=yellow>==></> Parsing Markdown ...');

Expand All @@ -116,6 +117,10 @@ protected function buildHtml(string $path)
'html', 'php', 'js', 'bash', 'json'
]));

if (is_callable($config['configure_commonmark'])) {
call_user_func($config['configure_commonmark'], $environment);
}

$converter = new GithubFlavoredMarkdownConverter([], $environment);

return collect($this->disk->files($path))
Expand Down

0 comments on commit c8f4fbe

Please sign in to comment.