righ / react-ipynb-renderer

ipynb renderer for ReactJS
https://docs.walkframe.com/react-ipynb-renderer
Apache License 2.0
14 stars 8 forks source link

feat: keep styles when output contain styles content #31

Closed DuLinRain closed 10 months ago

DuLinRain commented 10 months ago

eg:

{ "data": { "text/html": [ "<style type=\"text/css\" >\n", "#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col0,#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col1{\n", " background-color: #ffff00;\n", " color: #000000;\n", " }#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col2,#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col3{\n", " background-color: #ebf3eb;\n", " color: #000000;\n", " }#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col3,#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col2{\n", " background-color: #008000;\n", " color: #f1f1f1;\n", " }#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col0,#T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col1{\n", " background-color: #f2f2dd;\n", " color: #000000;\n", " }<table id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705\" > <th class=\"blank level0\" > <th class=\"col_heading level0 col0\" colspan=2>head0 <th class=\"col_heading level0 col2\" colspan=2>head2 <th class=\"index_name level1\" >head1 <th class=\"col_heading level1 col0\" >0 <th class=\"col_heading level1 col1\" >1 <th class=\"col_heading level1 col2\" >0 <th class=\"col_heading level1 col3\" >1 <th class=\"index_name level0\" >head3 <th class=\"blank\" > <th class=\"blank\" > <th class=\"blank\" > <th class=\"blank\" > \n", " \n", " <th id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705level0_row0\" class=\"row_heading level0 row0\" >0.0-0.0\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col0\" class=\"data row0 col0\" >20.14%\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col1\" class=\"data row0 col1\" >29.96%\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col2\" class=\"data row0 col2\" >28.00%\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row0_col3\" class=\"data row0 col3\" >20.92%\n", " \n", " \n", " <th id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705level0_row1\" class=\"row_heading level0 row1\" >0.0-52.0\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col0\" class=\"data row1 col0\" >29.86%\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col1\" class=\"data row1 col1\" >10.04%\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col2\" class=\"data row1 col2\" >18.08%\n", " <td id=\"T_cd4d4360_a0ab_11ee_b7df_7f859df5f705row1_col3\" class=\"data row1 col3\" >10.90%\n", " \n", " " ], "text/plain": [ "<pandas.io.formats.style.Styler at 0x7fc444772ad0>" ] }, "metadata": {}, "output_type": "display_data" },

the result may like below: image