-
Notifications
You must be signed in to change notification settings - Fork 1
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
Optionally print project path in table notes annotation #341
Conversation
I'll interactively test this a bit, but this is looking good to me aside from my minor comments above. |
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.
From a user perspective, this worked well for me on the project and I like the opt in approach. I'll leave the more thorough code review to @kyleam
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.
LGTM aside from typos mentioned above
Thanks, @kyleam ; working on the typos now. |
Summary
tab_notes()
gains the following argumentsoutput_dir
where (what directory) to save the file; respectspmtables.dir
path.type
how to renderoutput_dir
in the annotation;format_table_path()
; does equivalent of what we already do inmrggsave
Current default
Currently, we can take in the output file name and that gets
included in a table note. However, the decision about where
to save that file is deferred until we actually call
stable_save()
.The changes to pmtables include accepting the output file path
when we create the table. Now, if the user passes the output path
and it is included in the table annotation, we have to respect that
information when saving; it can't be changed after the annotation
is created.
Implementation detail
Currently, it is the
tab_notes()
function that handles all thearguments for R source file, output file, output directory etc. But
this is a but of a misnomer now, because the function doing more
than just writing a note and saving the file name for later; real
decisions about output file locations are being made.
I have added a non-exported function
tab_files()
that handlesall the file / path manipulation and arguments that get passed
to
tab_notes()
eventually go totab_files()
. In the future,I will open up
tab_files()
since that more accurately reflectswhere the file / path proecessing is taking place.
source-path.pdf