[PATCH] Add support for encoding tag to Rd2

Charlie Sharpsteen source at sharpsteen.net
Mon May 9 22:16:36 CEST 2011


As of R 2.13.0, R CMD check requires that all Rd files containing multibyte
character must contain an `\encoding{}` tag.

This patch causes Roxygen to transform `@encoding VALUE` into
`\encoding{VALUE}`.
---
 R/Rd2.R |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/R/Rd2.R b/R/Rd2.R
index 2d9688b..e17babb 100644
--- a/R/Rd2.R
+++ b/R/Rd2.R
@@ -65,7 +65,8 @@ make.Rd2.roclet <- function(subdir=NULL,
                           'slot')

   register.preref.parsers(parse.name,
-                          'docType')
+                          'docType',
+                          'encoding')

   register.srcref.parser('setClass',
                          function(pivot, expression)
@@ -425,7 +426,8 @@ make.Rd2.roclet <- function(subdir=NULL,
                                   'author',
                                   'seealso',
                                   'concept',
-                                  'docType')
+                                  'docType',
+                                  'encoding')

   roclet$register.parser('return',
                          function(key, expressions)
-- 
1.7.5.1

--bcaec548a2ef89b86b04a2dda70b
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

A patch that adds rudimentary support for `@encoding` is appended to this e=
mail. It should apply cleanly to the `pkg` subdirectory of the R-Forge repo=
sitory using `patch -p1`.<div><br></div><div>In R 2.13.0, R CMD check enfor=
ces the use of `\encoding{}` in all Rd files that contain multibyte charact=
ers. This makes support for `@encoding` in Roxygen essential for packages t=
hat use Roxygen for documentation and are released to CRAN.<div>

<br></div><div>-Charlie</div><div><br></div><div><br></div><div>----=A00001=
-Add-support-for-encoding-tag-to-Rd2.patch</div><div><div>From 4c74a2ef076c=
841bf35e4eefdb625176d70bce7d Mon Sep 17 00:00:00 2001</div><div>From: Charl=
ie Sharpsteen &lt;<a href=3D"mailto:source at sharpsteen.net">source at sharpstee=
n.net</a>&gt;</div>

<div>Date: Mon, 9 May 2011 13:16:36 -0700</div><div>Subject: [PATCH] Add su=
pport for encoding tag to Rd2</div><div><br></div><div>As of R 2.13.0, R CM=
D check requires that all Rd files containing multibyte</div><div>character=
 must contain an `\encoding{}` tag.</div>

<div><br></div><div>This patch causes Roxygen to transform `@encoding VALUE=
` into</div><div>`\encoding{VALUE}`.</div><div>---</div><div>=A0R/Rd2.R | =
=A0 =A06 ++++--</div><div>=A01 files changed, 4 insertions(+), 2 deletions(=
-)</div>

<div><br></div><div>diff --git a/R/Rd2.R b/R/Rd2.R</div><div>index 2d9688b.=
.e17babb 100644</div><div>--- a/R/Rd2.R</div><div>+++ b/R/Rd2.R</div><div>@=
@ -65,7 +65,8 @@ make.Rd2.roclet &lt;- function(subdir=3DNULL,</div><div>

=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&#39;slot&#39;)</div=
><div>=A0</div><div>=A0 =A0register.preref.parsers(<a href=3D"http://parse.=
name">parse.name</a>,</div><div>- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0&#39;docType&#39;)</div><div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0&#39;docType&#39;,</div>

<div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&#39;encoding&#39=
;)</div><div>=A0</div><div>=A0 =A0register.srcref.parser(&#39;setClass&#39;=
,</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 function(pi=
vot, expression)</div><div>@@ -425,7 +426,8 @@ make.Rd2.roclet &lt;- functi=
on(subdir=3DNULL,</div>

<div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0&#39;author&#39;,</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0&#39;seealso&#39;,</div><div>=A0 =A0 =A0 =A0 =A0=
 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&#39;concept&#39;,</div=
><div>- =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0=
&#39;docType&#39;)</div>

<div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0&=
#39;docType&#39;,</div><div>+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0&#39;encoding&#39;)</div><div>=A0</div><div>=A0 =A0r=
oclet$register.parser(&#39;return&#39;,</div><div>=A0 =A0 =A0 =A0 =A0 =A0 =
=A0 =A0 =A0 =A0 =A0 =A0 =A0 function(key, expressions)</div>

<div>--=A0</div><div>1.7.5.1</div><div><br></div></div></div>

--bcaec548a2ef89b86b04a2dda70b--


More information about the Roxygen-devel mailing list