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
allow setting header level (per analysis document) of session info chunk #139
Comments
@rgayler That's a great idea!
I think there are multiple ways to handle this without adding an extra setting. Here are some ideas. Please let me know if you like any of these: Manually include your own session information chunkThe function For example, this R Markdown file:
Creates the following HTML output: Use pandoc offset argumentA second option would be to use H2 headers for subsections along with the pandoc argument For example, this R Markdown file:
Creates the following HTML output: |
Thanks, John. I will almost certainly use option1 (explicitly call sessioninfo), because that has been my standard practice for a while and I generally use devtools::session_info. |
What version of workflowr was that introduced? I am using CRAN workflowr v1.1.1 and don't get that behaviour. I have tried inserting calls to sessionInfo() and devtools::session_info() and even naming the chunk session-info (as in your example) and none of them suppressed the automatic sessinfo. |
This was introduced in v1.0.0.
My apologies. I only gave you half of the solution. The full solution is documented in the section Change the session information function in the vignette Customize your research website. You need to add the entry |
Gotcha. I misinterpreted you as saying that workflowr searched for an occurrence of Tested. Works. Done. Thanks! |
@rgayler Not your fault. I did say that, and I was mistaken. This is because workflowr does search the document code when deciding whether or not the file should pass the reproducibility check (displayed at the top of the file). However, for the mechanism to insert the session info chunk, it currently requires the user to explicitly disable it in
Glad it's working! |
@rgayler Also note that I am considering getting rid of the level 2 header altogether. Instead the Session Information would be included as a collapsible button at the very end of each analysis. See #120 (comment) for discussions and screenshots. This change is part of an overhaul of the workflowr styling to be less intrusive. See #110 (comment) for how the workflowr report is changing. |
I enable section number in analysis document because I find it helpful when speaking with remote collaborators to be able to refer to a section number.
The sessioninfo chunk automatically inserted at the end of every analysis document has an H2 header. If I use H1 headers for my sections, then the sessioninfo chunk is rendered as a subsection of my last H1 section, which is usually not logical. If I use H2 for my top level headers, then all the headers are rendered as 0.n, which looks odd.
It would be helpful to be able to specify the header level of the sessioninfo chunk - preferably per analysis file.
The text was updated successfully, but these errors were encountered: