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

Merged
merged 21 commits into from
Jun 28, 2024
Merged

Add the opt_table_font() method #272

merged 21 commits into from
Jun 28, 2024

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 85.71429% with 5 lines in your changes missing coverage. Please review.

Project coverage is 86.45%. Comparing base (4f1af8d) to head (41b2a0f).

Current head 41b2a0f differs from pull request most recent head 11ddbb6

Please upload reports for the commit 11ddbb6 to get more accurate results.

Files Patch % Lines
great_tables/_options.py 85.29% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #272      +/-   ##
==========================================
+ Coverage   86.44%   86.45%   +0.01%     
==========================================
  Files          42       42              
  Lines        4654     4689      +35     
==========================================
+ Hits         4023     4054      +31     
- Misses        631      635       +4     

☔ 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
@github-actions github-actions bot temporarily deployed to pr-272 June 6, 2024 18:04 Destroyed
@rich-iannone rich-iannone marked this pull request as ready for review June 17, 2024 15:30
@machow machow self-requested a review June 17, 2024 15:31
@github-actions github-actions bot temporarily deployed to pr-272 June 18, 2024 15:01 Destroyed
@github-actions github-actions bot temporarily deployed to pr-272 June 18, 2024 15:01 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.

This is looking good! I added two quick comments on code tweaks, but feel free to push back on anything

great_tables/_options.py Show resolved Hide resolved
great_tables/_options.py Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to pr-272 June 27, 2024 22:45 Destroyed
@github-actions github-actions bot temporarily deployed to pr-272 June 28, 2024 15:16 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.

Thanks for this beautiful PR -- I added a couple small suggestions. If they sound okay, feel free to merge after changing (or punt the suggestions and merge :)

great_tables/_options.py Outdated Show resolved Hide resolved
great_tables/_options.py Outdated Show resolved Hide resolved
@rich-iannone
Copy link
Member Author

I've incorporated your suggestions in two commits. If CI passes I'll merge this PR. Thanks!

@rich-iannone rich-iannone merged commit 793bd2a into main Jun 28, 2024
@rich-iannone rich-iannone deleted the add-opt-table-font branch June 28, 2024 17:49
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