daizutabi/pheasant

Pheasant and tabbed extension

bcaessens opened this issue · 0 comments

Hi. Thanks for this great package. It seems to work fine in most cases. However I run into some troubles trying to get a pandas dataframe displayed as a nice table under either tabs, or collapsible blocks from the Details extension with Material for mkdocs.

Here is a basic example:

`{{
import pandas as pd
tmp = pd.DataFrame([[1, 2], [3, 4]], index=list('XY'), columns=list('ab'))
}}

Table

??? first view
{{ tmp }}

??? Second view
{{ tmp.transpose() }}

Rest of document`

If you run this code, the tables are shown but not under the collapsible block but just below them.
In addition, if we use tmp.to_markdown(), it renders the markdown raw table output inside the collapsible block. However, if we do not indent the inline code, like this:

??? first view {{ tmp.to_markdown() }}

Then the table output is a nice looking materials table, but again, no longer under the collapsible.

Ideally, we have the nice formatted table under the collapsible, or, at least the standard table, but under the collapsible.

It is the same issue with tabbed content, just replace ??? with === for tabs and similar output behaviour. Any clues ???