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

GitHub preview of README #399

Open
pawelru opened this issue Feb 18, 2025 · 7 comments
Open

GitHub preview of README #399

pawelru opened this issue Feb 18, 2025 · 7 comments
Assignees
Labels
Milestone

Comments

@pawelru
Copy link

pawelru commented Feb 18, 2025

The table in Other Resources is not GitHub friendly

https://github.com/insightsengineering/cards?tab=readme-ov-file#other-resources

Image

@ddsjoberg
Copy link
Collaborator

I know, it's not great in the repo, but I like the way it looks on the pkgdown site. the table has links so an image of the table would not suffice

@Melkiades
Copy link
Contributor

Melkiades commented Feb 18, 2025

I know, it's not great in the repo, but I like the way it looks on the pkgdown site. the table has links so an image of the table would not suffice

I also tried to publish a reprex of code in a PR comment, but it does not work with github as for the README. Can we make this possible somehow? maybe a hidden as_gt()? edit no as_gt() is not working ofc

@pawelru
Copy link
Author

pawelru commented Feb 18, 2025

How about a simple markdown table? I see nothing really special in that table. Except icons but that can be easily replaced I believe.

My concern here is that this way of preview is applied elsewhere. For instance, on r-universe it's looking good. However, on RSPM it's not looking well and on rdocumentation is complitely gone. My point is that this is probably not only for GH.

@ddsjoberg
Copy link
Collaborator

ddsjoberg commented Feb 18, 2025

I don't have any issues with the way the table appears on any of those platforms 😆 and I prefer the clean look of the html table compared to a markdown table

If you want to put together a PR swapping to a vanilla markdown table, we can take a look though!

@Melkiades
Copy link
Contributor

Melkiades commented Feb 18, 2025

Ok I see. Pawel's issue is different. I agree with @ddsjoberg for the readme, but for future github prints with reprex I would use this:

# Example 1 ----------------------------------
library(gtsummary)
trial |>
  select(age, grade, response) |>
  tbl_summary() |> 
  gtsummary::pkgdown_print.gtsummary()
Characteristic N = 2001
Age 47 (38, 57)
    Unknown 11
Grade
    I 68 (34%)
    II 68 (34%)
    III 64 (32%)
Tumor Response 61 (32%)
    Unknown 7
1 Median (Q1, Q3); n (%)

Created on 2025-02-18 with reprex v2.1.1

@ddsjoberg
Copy link
Collaborator

@Melkiades I think you're referring to something a little different. When the README.Rmd is rendered it creates the README.md and pkgdown only uses the md file and does not re-render the Rmd file.

@pawelru pawelru mentioned this issue Feb 24, 2025
12 tasks
@pawelru pawelru self-assigned this Feb 24, 2025
@ddsjoberg ddsjoberg added this to the v0.6.0 milestone Feb 26, 2025
@ddsjoberg
Copy link
Collaborator

After discussion with the cards dev team, we will keep the gt table. But we will put it in a pkgdown/index.Rmd file.

Things to check out:

  1. Can our pkgdown/index.Rmd inherit READM.Rmd and just add the gt table to the bottom? This would be good to keep the link between the README and the pkgdown website.
  2. Need to add a release checklist item to usethis::use_release_issue() to build the pkgdown/index.Rmd file. Check to see if devtools::build_readme() will build this (I assume it does not) or if there is a similar function in pkgdown.

@ddsjoberg ddsjoberg added the sme label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants