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

Suggestion: drop the smart parameter from output formats #1774

Closed
3 tasks done
atusy opened this issue Feb 18, 2020 · 2 comments
Closed
3 tasks done

Suggestion: drop the smart parameter from output formats #1774

atusy opened this issue Feb 18, 2020 · 2 comments

Comments

@atusy
Copy link
Collaborator

atusy commented Feb 18, 2020

The output formats have the smart parameter (e.g., html_document).
This parameter is passed to smart_extension and adds +smart when TRUE and adds nothing when FALSE.

rmarkdown/R/output_format.R

Lines 349 to 351 in 43def55

smart_extension <- function(smart, extension) {
c(extension, if (smart && pandoc2.0()) "+smart")
}

However, the smart extension is enabled by default in the Pandoc's markdown.

https://github.com/jgm/pandoc/blob/9feefa39319358acc84811e6017aeea60f9140c3/MANUAL.txt#L2627-L2628

This means, the smart extension is enabled regardless of the smart parameter (i.e., html_document(smart = TRUE) and html_document(smart = FALSE) cause the same result).

Thus, I suggest to drop smart parameter from the output formats.
By doing this, the user-specified smart parameter will be silently ignored as ellipsis.
If users really have to toggle the smart extension, they can do so via the md_extension parameter (i.e., md_extension = "-smart" disables the smart extension).
Currently, users have to specify both smart=FALSE and md_extension="-smart" to disable the smart extension.


By filing an issue to this repo, I promise that

  • I have fully read the issue guide at https://yihui.org/issue/.
  • I have provided the necessary information about my issue.
    • If I'm asking a question, I have already asked it on Stack Overflow or RStudio Community, waited for at least 24 hours, and included a link to my question there.
    • If I'm filing a bug report, I have included a minimal, self-contained, and reproducible example, and have also included xfun::session_info('rmarkdown'). I have upgraded all my packages to their latest versions (e.g., R, RStudio, and R packages), and also tried the development version: remotes::install_github('rstudio/rmarkdown').
    • If I have posted the same issue elsewhere, I have also mentioned it in this issue.
  • I have learned the Github Markdown syntax, and formatted my issue correctly.

I understand that my issue may be closed if I don't fulfill my promises.

@yihui
Copy link
Member

yihui commented May 28, 2020

This can be a breaking change, but the fewer arguments we have to maintain, the better. So I just removed it. I think I'll need to tweak some functions to add the ... argument as you suggested after I run revdep checks of rmarkdown. Thanks!

BTW, this may also affect Pandoc 1.x users. I can't say for sure, but Pandoc 1.x probably didn't enable the smart option by default (and one needs to specify --smart in command line; cf #1168). Since Pandoc 2.0 has been released for more than two years, I think it's worth dropping the support for this tiny feature.

yihui added a commit that referenced this issue May 30, 2020
only kept the argument of ioslides_presentation, because its lua filter still needs this option
yihui added a commit that referenced this issue May 30, 2020
only kept the argument of ioslides_presentation, because its lua filter still needs this option
@github-actions
Copy link

github-actions bot commented Dec 1, 2020

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants