Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAvoid pagetitle warning from pandoc2.0 when title is missing. #1355
Conversation
|
Looks great to me! Thanks! |
After my change was included in rmarkdown 1.10, the pagetitle was specified twice, which pandoc does not accept. Thus workflowr should only apply its fix for previous versions of rmarkdown. rstudio/rmarkdown#1355 rstudio/rmarkdown#1434
After my change was included in rmarkdown 1.10, the pagetitle was specified twice, which pandoc does not accept. Thus workflowr should only apply its fix for previous versions of rmarkdown. rstudio/rmarkdown#1355 rstudio/rmarkdown#1434
After my change was included in rmarkdown 1.10, the pagetitle was specified twice, which pandoc does not accept. Thus workflowr should only apply its fix for previous versions of rmarkdown. rstudio/rmarkdown#1355 rstudio/rmarkdown#1434
…#1355)" and revert "fix #1434: use --metadata:pagetitle only if both title and pagetitle in YAML are empty" This reverts commits 7ea4f08 and 19008bf. This is because applying `--metadata pagetitle=...` to all HTML output documents is too aggressive, and can cause new issues like #1607, which are even worse than the warning about the missing title. Fix #1607 and close #1608.
|
@jdblischak Sorry I decided to revert this PR, because it has brought a couple of new issues that would be too hard to fix. The first one was #1434, which was not too bad. The second one was #1607, which is not trivial to fix. I think the case #1607 is bad enough that it is worth reverting this PR. I don't know what your original motivation for this PR was (i.e. why the title could be missing in workflowr). If I understand the problem better, I might be able to come up with a direct fix to that problem. |
|
@yihui No worries. I apologize that my PR caused you and others so much difficulty. My original motivation was to remove the pandoc2 warning about a missing title:
I don't bother adding a title to most of the Rmd files I use to test workflowr, so all of those pandoc2 warnings were obscuring the true error messages whenever a test failed. I'll continue to handle this downstream in workflowr. |
|
Sounds good. Thanks @jdblischak! I also added titles to our tests: c38c5c8 |
I noticed the warning produced by pandoc 2+ when the R Markdown file does not have a title in the YAML header. This is the same warning as demonstrated for
find_external_resourcesin #1290. The fix in #1298 removes the warning only forfind_external_resources.This PR makes the change to the pre_processor function of
html_document_base, and thus it removes the warning for anything that inherits from this function (includingfind_external_resources).I also made two other minor improvements:
pagetitleif there is atitlespecified in the YAML header. This keeps the text displayed in the browser tab the same as the document title (which is the same behavior as pandoc 1.0)"PREVIEW", use the basename of the input file. This will make it easier to identify the browser tab. Also, this is similar to pandoc's fallback option.cc @rich-iannone
I tested this with R 3.3.3, pandoc 2.2.1, and macOS 10.10.5. I'm happy to test this on other operating systems if there is interest in merging this PR.
I've previously signed the individual contributor agreement.