danielfrg / pelican-jupyter

Pelican plugin for blogging with Jupyter/IPython Notebooks
Apache License 2.0
422 stars 105 forks source link

IPYNB_FIX_CSS nukes markdown table headers #112

Open jooh opened 5 years ago

jooh commented 5 years ago

Thanks for a great tool. I have a problem where markdown table headers disappear (they're there in the output source, but seem to get assigned 0 height).

Here is an example table (I also made a test notebook). I have the following markdown in a jupyter notebook cell:

| statistical test | null true | null false |
| :--- | :--- | :--- |
| **significant**     |  $\alpha$ false positive rate, false alarm  | $1-\beta$ power, sensitivity, recall, hit |
| **not significant** | $1-\alpha$ specificity, precision, correct rejection | $\beta$ false negative rate, miss |

The header row disappears in the rendered output with default options (this is on the pelican-bootstrap3 pelican theme with the lumen bootstrap theme):

Screenshot 2019-09-25 at 16 12 33

Unless I set IPYNB_FIX_CSS = False:

Screenshot 2019-09-25 at 16 13 20

Or alternatively, IPYNB_SKIP_CSS = True:

Screenshot 2019-09-25 at 16 29 16

I take this to mean that the notebook CSS is ok, but the 'fix' CSS somehow includes setting thead to zero height. How do I control this behavior?

jooh commented 5 years ago

I was able to hack around this by adding a link to the following CSS as the CUSTOM_CSS flag in pelican-bootstrap3. Probably no good if you have other pretty tables but at least it makes the notebook table headers appear.

/* ugly fix for table header issues. */
thead th {
    display: table-cell !important;
    padding-right: 15px !important;
    padding-bottom: 3px !important;
}

table td {
    padding-right: 15px !important;
    padding-bottom: 3px !important;
}