Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation or feature to enable glue to work with tables #1585

Open
ttimbers opened this issue Jan 3, 2022 · 0 comments
Open

Documentation or feature to enable glue to work with tables #1585

ttimbers opened this issue Jan 3, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@ttimbers
Copy link
Contributor

ttimbers commented Jan 3, 2022

Description / Summary

Following the docs here I can use syntax like this to generate a table, however, it get's called a figure and the formatting is very plain when rendering to PDF:

Code cell to generate glue table:

import pandas as pd
from sklearn.datasets import load_iris
from myst_nb import glue

data = load_iris()
df = pd.DataFrame(data.data, columns=data.feature_names)
glue("df_tbl", df)

markdown cell to glue in table:
Screen Shot 2022-01-03 at 1 03 42 PM

Resultant table when rendered to pdf:
Screen Shot 2022-01-03 at 1 04 20 PM

However, if I create a table using markdown, I can use the MyST syntax to get it labelled as a table and formatted nicely in pdf...

markdown cell to create markdown table:
Screen Shot 2022-01-03 at 1 05 33 PM

Resultant table when rendered to pdf:
Screen Shot 2022-01-03 at 1 06 00 PM

Value / benefit

Is it possible to make a nicely labelled and rendered table like that from a pandas data frame in Jupyter book yet using glue? If so, is there documentation for this, or if you show me how, I would be happy to create a PR to add it. If not, this would be a very valuable feature for Jupyter books - and comparable features exist in bookdown (the R world's alternative to Jupyter book).

Implementation details

No response

Tasks to complete

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant