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

Add the opt_table_font() method #272

Draft
wants to merge 14 commits into
base: main
Choose a base branch
from
Draft

Conversation

rich-iannone
Copy link
Member

This adds the opt_table_font() method, which can be used for the easy addition of fonts (or a font stack) to the table. Here's an example where a font stack was used:

from great_tables import GT, exibble

gt_ex = (
    GT(exibble.head(5), rowname_col="row", groupname_col="group")
    .tab_header("THE HEADING", "(a subtitle)")
    .tab_stubhead("THE STUBHEAD")
    .tab_source_note("THE SOURCE NOTE")
    .opt_table_font(stack="industrial")
)

gt_ex
opt_table_font_font_stack

Here's another example where a single font name is prepended to the list of default fonts:

from great_tables import GT, exibble

gt_ex = (
    GT(exibble.head(5), rowname_col="row", groupname_col="group")
    .tab_header("THE HEADING", "(a subtitle)")
    .tab_stubhead("THE STUBHEAD")
    .tab_source_note("THE SOURCE NOTE")
    .opt_table_font(font="Comic Sans MS")
)

gt_ex
opt_table_font_prepend_font

Fixes: #175

@github-actions github-actions bot temporarily deployed to pr-272 April 10, 2024 16:42 Destroyed
Copy link
Collaborator

@machow machow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, thanks for opening. What's the status of #262 and #260? I think we should pause this, in order to finish out prior work.

@github-actions github-actions bot temporarily deployed to pr-272 April 10, 2024 17:39 Destroyed
@rich-iannone
Copy link
Member Author

Sounds good. PR #260 is ready for a re-review.

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 93.75000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 86.85%. Comparing base (b6aa4f8) to head (e192a18).

Files Patch % Lines
great_tables/_options.py 93.54% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   86.77%   86.85%   +0.07%     
==========================================
  Files          42       42              
  Lines        4546     4578      +32     
==========================================
+ Hits         3945     3976      +31     
- Misses        601      602       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions github-actions bot temporarily deployed to pr-272 June 4, 2024 14:30 Destroyed
@github-actions github-actions bot temporarily deployed to pr-272 June 6, 2024 14:43 Destroyed
@github-actions github-actions bot temporarily deployed to pr-272 June 6, 2024 15:29 Destroyed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add opt_table_font()
2 participants