-
Notifications
You must be signed in to change notification settings - Fork 5
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
Custom plots vignette #162
Conversation
Instructions for code reviewerHello reviewer, thanks for taking the time to review this PR!
Checklist
|
vignettes/custom-figs-tabs.Rmd
Outdated
|
||
## Saving text | ||
|
||
Once written, you'll have to save your captions and alt text. While you could save it in the captions_alt_text.csv file (created if you've already generated a figure or table rda), we recommend saving these in a separate file to avoid loss if the captions_alt_text.csv file is overwritten. |
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.
Thinking about this a little more, maybe we can set the fxn that generates this csv to append/replace the rows it matches rather than overwrite?
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.
Here's an idea that should eliminate overwriting risks: I set up write_captions to check for an existing captions_alt_text.csv file; if absent, then it creates one. Right now, it creates one (overwrites an existing one) if it's called (which shouldn't happen in a typical workflow, but it's possible).
Otherwise, the captions_alt_text.csv shouldn't be overwritten. It's only called again in add_more_key_quants, which intakes the captions_alt_text.csv as a df, pulls out one row (specific to the table or figure it's associated with), changes it by substituting more key quantities, replaces the old row with the new row, and then reexports the df to captions_alt_text.csv so that only that specific row is changed.
If you're on board with this idea, I can change the satf::write_captions fxn as described, and update this workflow so that they add their captions/alt text to their existing captions_alt_text.csv file.
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.
Works for me!
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.
I think this is a great start to this vignette. I would like to talk about this more during our meeting tomorrow because I can foresee some issues/confusion with the workflow. The vignette also does not address custom figures/tables that are read in as PNGs or if users wanted to code directly into an R chunk in the quarto doc.
I think the vignette could benefit from a step-by-step overview of the workflow with hyper links to each of the sections below it.
Thanks! I'll put it on the agenda for our meeting. I'll also explicitly add that this workflow will be of use if users want to add already-made plots (e.g., PNG) and how users can directly code a plot into a quarto doc. I can also add a step-by-step overview with some more detail than is covered in the table of contents, which will contain the links to heading 1 and 2 sections. |
ff173ff
to
3886685
Compare
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.
I like it! It's long but the detail is needed. The only thing it needs is the TOC in a sidebar so people can better navigate - which I know we can't figure out why that's not working
What is the feature?
How have you implemented the solution?
Does the PR impact any other area of the project, maybe another repo?