简体   繁体   English

Windows R CMD 检查顶级文件:(README)[警告]此文档格式需要非空<title>元素&lt;/div&gt;</title><div id="text_translate"><p> 我已在 Win、OSX 和 Linux 上为 R 激活 GitHub 对 CI 的操作。 在 Windows 上只发生以下警告(变成错误)。</p><pre> * checking top-level files... WARNING Conversion of 'README.md' failed: [WARNING] This document format requires a nonempty &lt;title&gt; element. Please specify either 'title' or 'pagetitle' in the metadata, eg by using --metadata pagetitle="..." on the command line. Falling back to 'README'</pre><p> <a href="https://github.com/UBESP-DCTV/covid19ita/pull/62/checks?check_run_id=594799232" rel="nofollow noreferrer">这里</a>是完整的报告。</p><p> 似乎它是由 CMD 直接检查调用的,因此我无法更改对 pandoc 的调用。</p><p> 另一方面,我尝试在README.Rmd header 中包含一个 pandoc 参数,正如<a href="https://community.rstudio.com/t/rmarkdown-document-format-requires-a-nonempty-title-element/36774" rel="nofollow noreferrer">这里</a>所建议的那样:</p><pre> output: github_document: pandoc_args: "--number-offset=1,0" toc: true pagetitle: covid19ita</pre><p> 它没有效果。</p><p> 注意:我不会从 CMD 检查中删除error_on = "warning" 。</p><p> 我该怎么做才能使测试也通过胜利?</p></div>

[英]Windows R CMD check top-level files: (README) [WARNING] This document format requires a nonempty <title> element

I have activated GitHub Action to CI for R on Win, OSX, and Linux.我已在 Win、OSX 和 Linux 上为 R 激活 GitHub 对 CI 的操作。 On Windows only happen the following warning (which is turned into an error).在 Windows 上只发生以下警告(变成错误)。

* checking top-level files ... WARNING

Conversion of 'README.md' failed:

[WARNING] This document format requires a nonempty <title> element.

  Please specify either 'title' or 'pagetitle' in the metadata,

  e.g. by using --metadata pagetitle="..." on the command line.

  Falling back to 'README'

here the full report. 这里是完整的报告。

It seems it is called by CMD check directly, hence I cannot change the call to pandoc.似乎它是由 CMD 直接检查调用的,因此我无法更改对 pandoc 的调用。

On the other hand, I tried to include a pandoc argument into the README.Rmd header as it was suggested here :另一方面,我尝试在README.Rmd header 中包含一个 pandoc 参数,正如这里所建议的那样:

output:
  github_document: 
    pandoc_args: "--number-offset=1,0"
    toc: true
pagetitle: covid19ita

It has no effect.它没有效果。

NOTE: I would not remove error_on = "warning" from CMD check.注意:我不会从 CMD 检查中删除error_on = "warning"

What can I do to make the test pass on win too?我该怎么做才能使测试也通过胜利?

It seems that the main issue is related to the inability to fetch badges in the rendered document.似乎主要问题与无法在呈现的文档中获取徽章有关。 That could be seen here (pass for R3.5 but not for R3.6), or here (pass for R3.6 but not for R3.5), and here (where the missing badge is no more the AppVeyor one but the CodeCov one).可以在这里看到(通过 R3.5 但不是 R3.6),或者在这里(通过 R3.6 但不是 R3.5)和这里(丢失的徽章不再是 AppVeyor 之一,而是CodeCov 一)。

So my current solution is to be sure all the badges are ready before or change after the check action takes place (eg using only gh-action).所以我目前的解决方案是确保所有徽章在检查操作发生之前之后都准备好(例如,仅使用 gh-action)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM