Skip to content

Commit

Permalink
Merge pull request #19 from tarekdj/patch-1
Browse files Browse the repository at this point in the history
Fixes #18: Table not generate
  • Loading branch information
themsaid authored Nov 18, 2020
2 parents c2db3e2 + a18ddf3 commit 17346ae
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Commands/BuildCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Filesystem\Filesystem;
use Symfony\Component\Console\Command\Command;
use League\CommonMark\Block\Element\FencedCode;
use League\CommonMark\Extension\Table\TableExtension;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Spatie\CommonMarkHighlighter\FencedCodeRenderer;
Expand Down Expand Up @@ -108,6 +109,7 @@ protected function buildHtml(string $path)
$this->output->writeln('<fg=yellow>==></> Parsing Markdown ...');

$environment = Environment::createCommonMarkEnvironment();
$environment->addExtension(new TableExtension());

$environment->addBlockRenderer(FencedCode::class, new FencedCodeRenderer([
'html', 'php', 'js', 'bash', 'json'
Expand Down
23 changes: 23 additions & 0 deletions stubs/assets/theme-dark.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,29 @@
blockquote.warning strong {
color: #dd787d;
}

table {
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #ddd;
padding: 8px;
}

tr:nth-child(even){
background-color: #113e63;
color: #011627;
}

th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #001321;
color: white;
}
</style>

</header>
Expand Down
20 changes: 20 additions & 0 deletions stubs/assets/theme-light.html
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,26 @@
blockquote.warning strong {
color: #c0262b;
}

table {
border-collapse: collapse;
width: 100%;
}

td, th {
border: 1px solid #ddd;
padding: 8px;
}

tr:nth-child(even){background-color: #f2f2f2;}

th {
padding-top: 12px;
padding-bottom: 12px;
text-align: left;
background-color: #525252;
color: white;
}
</style>

</header>
Expand Down

0 comments on commit 17346ae

Please sign in to comment.