简体   繁体   English

在 Roxygen2 样式文档中转义“@”

[英]Escaping "@" in Roxygen2 Style Documentation

Let's say I have a comment block where I'd like to write an email address.假设我有一个评论块,我想在其中写一个电子邮件地址。 How would I go about escaping the "@" symbol so roxygen treats it as text instead of a directive?我将如何转义“@”符号,以便 roxygen 将其视为文本而不是指令?

A double at-sign @@ will do the job.双 at 符号@@将完成这项工作。

As an example, take the email address in the author field of this documentation:以本文档作者字段中的电子邮件地址为例:

##' A package to check Roxygen's sanity.
##' @name helloRoxygen-package
##' @docType package
##' @author My name \email{me@@here.org}
NA

which produces this *.Rd file when processed with roxygenize() :使用roxygenize()处理时会生成此*.Rd文件:

\docType{package}
\name{helloRoxygen-package}
\alias{helloRoxygen-package}
\title{A package to check Roxygen's sanity.}
\description{
  A package to check Roxygen's sanity.
}
\author{
  My name \email{me@here.org}
}

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

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