Verbatim output in roxygen2 package documentation

早过忘川 提交于 2019-12-22 04:44:15

问题


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    

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

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


回答1:


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

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...

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.



来源:https://stackoverflow.com/questions/17061016/verbatim-output-in-roxygen2-package-documentation

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!