-
Notifications
You must be signed in to change notification settings - Fork 73
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
docs: visually document options for theming table with opt_stylize()
#438
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #438 +/- ##
==========================================
+ Coverage 86.37% 86.68% +0.30%
==========================================
Files 42 42
Lines 4683 4685 +2
==========================================
+ Hits 4045 4061 +16
+ Misses 638 624 -14 ☔ View full report in Codecov by Sentry. |
From pairing with @machow , we decided to streamline the display of the themed tables from Here's a portion of the page for the revised docs: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a small suggestion to link to the reference page for color options, and to link to the guide from the reference. Feel free to take or leave it 😁
``` | ||
::: | ||
:::::: | ||
|
||
Notice that first table (blue) emphasizes the row labels with a solid background color. The second table (red) emphasizes the column labels, and uses solid lines to separate the body cell values. | ||
Notice that first table (blue) emphasizes the row labels with a solid background color. The second table (red) emphasizes the column labels, and uses solid lines to separate the body cell values. There are six options for the `color=` argument: `"blue"`, `"cyan"`, `"pink"`, `"green"`, `"red"`, and `"gray"`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT of us replacing this sentence enumerating all colors with a link to the reference page (which enumerates them)? could add a note w/ a link like "see .opt_stylize()
for all color options"
Maybe we could also add a link on the .opt_stylize()
page to this guide? (e.g. "for examples of each style, see {Linked Name of Guide Page}")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good! I'll make those changes.
great_tables/_options.py
Outdated
@@ -1250,7 +1250,9 @@ def opt_stylize(self: GTSelf, style: int = 1, color: str = "blue") -> GTSelf: | |||
have vertical lines. In addition to choosing a `style` preset, there are six `color` variations | |||
that each use a range of five color tints. Each of the color tints have been fine-tuned to | |||
maximize the contrast between text and its background. There are 36 combinations of `style` and | |||
`color` to choose from. | |||
`color` to choose from. For examples of each style, see the | |||
[*Premade Themes*](https://posit-dev.github.io/great-tables/get-started/table-theme-premade.html) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind using quarto style linking, to refer to the qmds? Absolute links will not work correctly on site previews / if the site is moved.
https://quarto.org/docs/websites/index.html#linking
It looks like the path to the qmd may have been incorrect before (it's inside the get-started folder)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link is now functional.
This adds documentation in the
Get Started
guide, showing some possibilities for theming the table withopt_stylize()
. With the six options in both thestyle=
andcolor=
arguments, there's a combined 36 different looks. Here, we show the six different styles with the default"blue"
color, and, we show the six different color options with the default style (1
).This is what it looks like on a desktop browser (zoomed out a bit):
On a narrow display, the tables collapse to a single column.
Fixes: #405