-
Notifications
You must be signed in to change notification settings - Fork 236
Closed
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorrd ✍️wipwork in progresswork in progress
Description
I'd like to hyperlink mentions of the {{
operator in the rlang doc because it is not easily searchable.
Here is a counter example with !!
that works well:
gen <- function(body) {
header <- "
#' Foo
#' @md
#' @name foo
#' @description
#'"
text <- paste0(c(header, body, "NULL"), collapse = "\n")
roxygen2::roc_proc_text(roxygen2::rd_roclet(), text)
}
gen("#' [`!!`][op-inject]")
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{Foo}
#> \description{
#> \code{\link[=op-inject]{!!}}
#> }
I would like to generate a similar link for {{
, properly escaped:
#> \code{\link[=op-inject]{\{\{}}
Ideally [`{{`][foo]
would work but here is what we get:
gen("#' [`{{`][op-embrace]")
#> Warning: [<text>:5] @description mismatched braces or quotes
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{Foo}
#> \description{
#>
#> }
Escaping {
does not work (same result with \\\\{\\\\}
):
gen("#' [`\\{\\{`][op-embrace]")
#> Warning: [<text>:5] @description mismatched braces or quotes
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{Foo}
#> \description{
#>
#> }
And unfortunately, trying to insert Rd manually does not work either
gen("#' \\code{\\link[=foo]{\\{\\{}}}}")
#> Warning: [<text>:5] @description mismatched braces or quotes
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{Foo}
#> \description{
#>
#> }
gen("#' \\code{\\link[=foo]{\\\\{\\\\{}}}}")
#> $foo.Rd
#> % Generated by roxygen2: do not edit by hand
#> % Please edit documentation in ./<text>
#> \name{foo}
#> \alias{foo}
#> \title{Foo}
#> \description{
#> \code{\link[=foo]{\\{\\{}}}}
#> }
Fixing [`{{`][foo]
so that it works as expected would be great. But I'd appreciate pointers to a workaround as well.
Metadata
Metadata
Assignees
Labels
bugan unexpected problem or unintended behavioran unexpected problem or unintended behaviorrd ✍️wipwork in progresswork in progress