Skip to content

Conversation

@Melkiades
Copy link
Contributor

What changes are proposed in this pull request?

  • Removed bold header for tbl_strata.

#133


Pre-review Checklist (if item does not apply, mark is as complete)

  • All GitHub Action workflows pass with a ✅
  • PR branch has pulled the most recent updates from master branch: usethis::pr_merge_main()
  • If a bug was fixed, a unit test was added.
  • Code coverage is suitable for any new functions/features (generally, 100% coverage for new code): devtools::test_coverage()
  • Request a reviewer

Reviewer Checklist (if item does not apply, mark is as complete)

  • If a bug was fixed, a unit test was added.
  • Run pkgdown::build_site(). Check the R console for errors, and review the rendered website.
  • Code coverage is suitable for any new functions/features: devtools::test_coverage()

When the branch is ready to be merged:

  • Update NEWS.md with the changes from this pull request under the heading "# cards (development version)". If there is an issue associated with the pull request, reference it in parentheses at the end update (see NEWS.md for examples).
  • All GitHub Action workflows pass with a ✅
  • Approve Pull Request
  • Merge the PR. Please use "Squash and merge" or "Rebase and merge".

Comment on lines +56 to +58
"tbl_strata-fn:addnl-fn-to-run" =
\(x) {
crane::modify_header_rm_md(x, md = "bold", type = "star")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am thinking how to make it more general but this would fix tbl_strata if something like this is added to tbl_strata:

  # running any additional mods
  get_theme_element("tbl_hierarchical-fn:addnl-fn-to-run", default = identity) |>
    do.call(list(x))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

what do you think @edelarua?

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not sure Daniel would be open to modifying tbl_strata() for this. Is it possible to do all within crane?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's no introduce chagnes into gtsummary for this. I see two potential solutions.

  1. Abandon, and whenever we use this function in the catalog, we specify the .header argument to remove teh bold.
  2. We could also set pkgwide-fun:pre_conversion with a function that removes the markdown bold syntax from from spanning headers in x$table_styling. This would occur jsut before the gtsummary table is converted to flextable.

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.

5 participants