AnswerDotAI / AnswerDotAI/nbdev

Dataframe HTML tags showing up in exported README

オープン
#1,155 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
bug
主要言語
Jupyter Notebook
スター
5.3k
フォーク
513
平均マージ
2日 30分
マージ済み PR(30日)
8

説明

Related to https://github.com/fastai/nbdev/issues/474

Rendered readme on Github: https://github.com/rxavier/poniard/blob/experiment/nbdev/README.md
index.ipynb: https://github.com/rxavier/poniard/blob/experiment/nbdev/nbs/index.ipynb

Basically, "raw output" dataframes (for example, when a method simply returns a dataframe, like `get_results` in this example) get this added before the actual table in markdown:

```
.dataframe tbody tr th:only-of-type { vertical-align: middle; }
.dataframe tbody tr th {
vertical-align: top;
}

.dataframe thead th {
text-align: right;
}

```

Meanwhile, dataframes rendered with `display(HTML(df.to_html()))` (which shows after `setup` in this example) display fine.

Quarto HTML docs render any of these fine.

Edit: I implemented an ugly temporary fix by using directives and ipython's `display`:

```python
#| output: false

obj.method_that_outputs_a_df()
```

```python
#| echo: false

from ipython import display, HTML

df = obj.method_that_outputs_a_df()
display(HTML(df.to_html()))
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with nbs/index.ipynb and the exported README linked in the issue, then reproduce a raw dataframe return such as get_results and compare it with display(HTML(df.to_html())). The fix is complete when exported README markdown renders the dataframe without the unwanted style tags, while the table remains visible.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
jupyter-notebook, python
領域
documentation
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。