[Rcpp-commits] r955 - in pkg/base64: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Apr 3 15:50:01 CEST 2010


Author: romain
Date: 2010-04-03 15:50:01 +0200 (Sat, 03 Apr 2010)
New Revision: 955

Modified:
   pkg/base64/R/base64.R
   pkg/base64/man/img.Rd
Log:
added an alt argument to img

Modified: pkg/base64/R/base64.R
===================================================================
--- pkg/base64/R/base64.R	2010-04-03 11:00:14 UTC (rev 954)
+++ pkg/base64/R/base64.R	2010-04-03 13:50:01 UTC (rev 955)
@@ -6,13 +6,14 @@
 	invisible( .Call( "encode_", input, output, as.integer(linesize), PACKAGE = "base64" ) )
 }
 
-img <- function( file, Rd = FALSE ){
+img <- function( file, Rd = FALSE, alt = "image" ){
 	tf <- tempfile()
 	on.exit( unlink(tf) )
 	encode( file, tf )
-	sprintf( '%s<img src="data:image/png;base64,\n%s" />%s', 
+	sprintf( '%s<img src="data:image/png;base64,\n%s" alt="%s" />%s', 
 		if( Rd ) "\\out{" else "", 
 		paste( readLines( tf) , collapse = "\n" ), 
+		alt,
 		if( Rd ) "}" else ""
 	)	
 }

Modified: pkg/base64/man/img.Rd
===================================================================
--- pkg/base64/man/img.Rd	2010-04-03 11:00:14 UTC (rev 954)
+++ pkg/base64/man/img.Rd	2010-04-03 13:50:01 UTC (rev 955)
@@ -28,11 +28,12 @@
 }
 
 \usage{
-img(file, Rd = FALSE)
+img(file, Rd = FALSE, alt = "image" )
 }
 \arguments{
   \item{file}{png file to translate into a data uri}
   \item{Rd}{if TRUE, extra markup is added to facilitate inclusion of the image in an Rd file}
+  \item{alt}{alternate text}
 }
 \value{
 The html code



More information about the Rcpp-commits mailing list