When using a pelican theme based on bootstrap and bootswatch like iliork, it may be a headache to make the css redecorations provided by bootstrap get applied to those html tags generated by python modules. For <pre>
and <code>
generated by pygments, you have to write your own css because bootstrap provides no code highlighting css. But for <table>
generated by python-markdown's table extension, there are css decorations provided by bootstrap and bootswatch. You can write your own css for <table>
, no problem, but at the loss of elegance and convenience when switching bootstrap theme.
So I write this extension for pelican to rewrite the html output of python-markdown's table extension from <table>
to <table class="table table-strip...">
to make bootstrap's css available.
A neater way is to modify the table extension of python-markdown to make it accept arguments such as 'class=table table-strip...'
. But that will cause trouble in distributing and getting merged by upstream and perhaps also contradict the KISS-style of python-markdown as a markdown parser.