etiennebacher / altdoc

Alternative to pkgdown to document R packages
https://altdoc.etiennebacher.com
Other
67 stars 9 forks source link

Cell wrap #289

Closed vincentarelbundock closed 2 months ago

vincentarelbundock commented 2 months ago

I tried to investigate this, but couldn't figure it out.

Why is the second column of the "Arguments" table not word-wrapped here?

https://grantmcdermott.com/tinyplot/man/tinyplot.html

etiennebacher commented 2 months ago

This was due to weird \verb{} tags in the Rd files that were caused by a typo in the original docs: https://github.com/grantmcdermott/tinyplot/pull/200.

Closing since there's nothing to do on our side (except maybe reporting this weird case to roxygen2)

etiennebacher commented 2 months ago

Worth noting that this is likely not a bug in roxygen2. It seems that when the code in backticks is valid R code, it is wrapped in \code{} but if it's not it's wrapped in \verb{}:

### Valid R code
roxygen2::roc_proc_text(roxygen2::rd_roclet(), "
  #' @title Foo
  #' @param axes Some text: `1 + 1`
  foo <- function() {}
")
$foo.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in ./<text>
\name{foo}
\alias{foo}
\title{Foo}
\usage{
foo()
}
\arguments{
\item{axes}{Some text: \code{1 + 1}}
}
\description{
Foo
}
### Invalid R code
roxygen2::roc_proc_text(roxygen2::rd_roclet(), "
  #' @title Foo
  #' @param axes Some text: `1 1`
  foo <- function() {}
")
$foo.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in ./<text>
\name{foo}
\alias{foo}
\title{Foo}
\usage{
foo()
}
\arguments{
\item{axes}{Some text: \verb{1 1}}
}
\description{
Foo
}
vincentarelbundock commented 2 months ago

What a weird issue. And amazing investigation. Thanks for taking the time!