[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-devel
Subject:    Re: [Rd] HTML documentation check: 'condition must be plain text'
From:       Kurt Hornik <Kurt.Hornik () wu ! ac ! at>
Date:       2022-06-26 13:13:39
Message-ID: 25272.23427.799527.208421 () hornik ! net
[Download RAW message or body]

> > > > > Kurt Hornik writes:

Changed now.

Best
-k

> > > > > Ivan Krylov writes:
> > Hi,
> > Use of \Sexpr in an \if condition in R documentation results in a NOTE,
> > but only during HTML documentation check, not any of the previous Rd
> > checks:

> > \if{\Sexpr{'TRUE'}}{The condition evaluates to true.}

> > * checking HTML version of manual ... NOTE
> > Encountered the following conversion/validation errors:
> > foo.Rd:10: condition must be plain text

> > Is this supported? "Writing R documentation" §2.11 seems to agree:

> > > > Also accepted [as a condition] are TRUE (matching all formats) and
> > > > FALSE (matching no formats). These could be the output of the \Sexpr
> > > > macro.

> > In order to check the HTML documentation, check_Rd2HTML() runs
> > tools::Rd2HTML() on the results of tools::Rd_db() [1]. The former runs
> > \Sexpr[stage=render] macros and the latter runs \Sexpr[stage=build]
> > macros, leaving \Sexpr[stage=install] macros unevaluated. The NOTE goes
> > away if I switch the "stage" argument to anything but "install".

> > Is there any downside to adding stages = c('build', 'install') to the
> > Rd_db call or stages = c('install', 'render') to the Rd2HTML call in
> > order to make this NOTE go away?

> Thanks for spotting this.  There is in the current check code which
> builds the Rd db from the package sources in which case one cannot
> safely assume that install (as well as render) stage Sexprs can be
> processed.  I'll try to change this so that we use the installed package
> if possible etc.

> Best
> -k

> > -- 
> > Best regards,
> > Ivan

> > [1]
> > https://github.com/r-devel/r-svn/blob/d25e77715164e39c96baae4c180d8f980ec93932/src/library/tools/R/check.R#L4911-L4939
> > 

> > ______________________________________________
> > R-devel@r-project.org mailing list
> > https://stat.ethz.ch/mailman/listinfo/r-devel

> ______________________________________________
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic