pbs-assess / csasdown

:book: An R package for creating CSAS reports in PDF or Word format with R Markdown and bookdown
Other
47 stars 17 forks source link

Fix check for `citation_french` in `set_citations()` #264

Open seananderson opened 3 months ago

seananderson commented 3 months ago

set_citations() has a check:

 if(fr()){
    if(!length(ca_ind)){
      warning("You are missing the `citation_english:` tag in your YAML file:\n",
              fn, ". This citation is required when you build in French as it ",
              "is set to the other language citation on page 2 of ",
              "the document")
      return(invisible())
    }
  }else{
    if(!length(cf_ind)){
      warning("You are missing the `citation_french:` tag in your YAML file:\n",
              fn, ". This citation is required when you build in English as it ",
              "is set to the other language citation on page 2 of ",
              "the document")
      return(invisible())
    }
  }

But not all templates have or use citation_english and citation_french. E.g. in Tech Reports are usually only in one language and the Res Docs use citation_other_language. For now, I turned this to a message instead of warning, because it was breaking several unit tests and therefore R CMD check.