roxygen2软件包文档中的逐字输出 [英] Verbatim output in roxygen2 package documentation

查看:296
本文介绍了roxygen2软件包文档中的逐字输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在RStudio中使用roxygen2生成软件包文档.如何强制@description部分中的以下内容显示为逐字固定字体?

I am using roxygen2 from within RStudio to generate package documentation. How do I force the following in the @description section to appear as verbatim fixed-font?

SettingID    Value    
RedItem      Patient_10574    
GreenItem    Record_433    

我的解决方法是将其放入@examples \ dontrun {},但这不是我想要的.

My workaround is to put it into @examples \dontrun{}, but that's not what I want.

@Joshua Ulrich在此处找到了(非)解决方案

@Joshua Ulrich found a (non-)solution to here

推荐答案

更新:roxygen2中的包装功能现已默认关闭,因此这不再是问题.

UPDATE: Wrapping is now turned off by default in roxygen2, so this should not be an issue anymore.

我为roxygen2发明了一种新的注释语法,该语法将保留换行:注释以

I have invented a new comment syntax for roxygen2 that will preserve wrapping: Comments starting with

#''

根本没有包装.我的参考实现还没有

are not wrapped at all. My reference implementation hasn't received much attention yet, though...

当然,完全关闭包装也是解决此问题的一种方法,但是我想知道如果开发人员忘记包装她的roxygen注释,那么在命令行终端中的帮助是什么样子的呢?一定是有理由首先引入包装的原因.

Of course, turning off wrapping altogether is also a way to handle the problem, but I wonder how the help looks like in a command-line terminal if the developer forgets to wrap her roxygen comments... There must have been a reason why wrapping was introduced in the first place.

这篇关于roxygen2软件包文档中的逐字输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆