NEWS.md
The as-is LaTeX vignette now uses %\VignetteEncoding{UTF-8}
.
Fix help-page issues.
LaTeX vignettes failed with Undefined control sequence. \pdfsuppressptexinfo
with old LaTeX versions.
rcat()
for RspShSourceCode
was not registered as an S3 method.findAsciiDoc()
failed to parse asciidoc --version
for asciidoc 9.0.0rc1, resulting in an error. The error message was also incorrectly formatted.rcat('<%@meta language="sh"%><% now=$(date) %>It is now <%= $now %>')
.rstring()
lost the language
meta tag.R.rsp::buildVignette()
is defunct in favor of tools::buildVignette()
.Removed defunct write()
for RspResponse
- use writeResponse()
instead.
Removed defunct attribute verbatim
for RSP include
preprocessing directives. Use attribute type
instead.
content
values of length greater than one, e.g. <%@string a="${letters}"%>
causing a
to have value base::letters
. Such values are now pasted together into a single string without separators.write()
for RspResponse
is now defunct - use writeResponse()
._R_CHECK_DEPENDS_ONLY_=true
and digest not being installed. Now importing digest.Deprecated write()
for RspResponse
- use writeResponse()
instead.
Replaced parse()
with parseDocument()
, parseCode()
, parseDirectory()
, and parseExpression()
.
WORKAROUND: If the generated RSP output contains invalid characters in the current encoding and is longer than 10,000 characters, it may result in an infinite loop of warnings generated by base::cat()
(at least on Linux). This is now detected and writeBin()
is used as fallback for outputting. For details, see R-devel thread https://stat.ethz.ch/pipermail/r-devel/2017-January/073571.html.
RspRSourceCodeFactory
did not preserve \unnnn
encoded UTF-8 characters (they where turned into "<U+NNNN>"
strings).
rcode()
would sometimes return NULL.
When used on *.html.rsp vignettes, vignette engine R.rsp::rsp
would delete the generated *.html immediately after being produced.
R CMD build
drops such “empty” tangle R files but that is a different story). This was done in order to hotfix / workaround PR #17185 (https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17185)findAsciiDoc()
and findPandoc()
is more liberal when trying to infer and parse the version of the executable and if they still fail they give more informative error messages.knitr::pandoc()
in knitr (>= 1.13) appends _utf8
to output HTML filename (to the part before the extension). This caused one of the vignette engines to fail. Now _utf8
is dropped from the HTML filename if this is detected.Deprecated several methods that was part of the old API, e.g. compileRsp()
, sourceRsp()
, translateRsp()
etc.
Removed epsDev()
, which has been defunct since R.rsp 0.19.7 (Jan 2015).
Workaround for markdown (<= 0.5.4) (Jan 2013) removed.
rscript()
to rcode()
. rscript()
is now deprecated.Added vignette option %\VignetteCompression{}
for alternative way of setting meta variable compression
, e.g. %\VignetteCompression{gs(ebook)+qpdf}
to compressed PDF output.
Added postprocessor for PDF compression, which can be enabled and controlled via meta variable compression
, e.g. <%@meta compression="gs(ebook)"%>
.
Setting meta variable postprocess
to FALSE can now be used to disable postprocessing, e.g. <%@meta postprocess="FALSE"%>
in foo.md.rsp builds foo.md and does not continue compiling into an HTML document, which is otherwise the default.
ROBUSTNESS: findPandoc()
could give an error if the pandoc
executable failed for unpredictable reasons. Now it returns NULL if that is the case. Same for findAsciidoc()
.
Explicit import of methods functions.
LEGACY CODE: Old RSP -> R script compiler could generate invalid R syntax for multiline RSP code expressions put in R source code comments. Not sure why this all of a sudden shows up; maybe something changed in R that causes the bug to reveal itself. This is old legacy code so the default / modern RSP engine is unaffected.
LEGACY CODE: While trying to generate an error, another error was thrown.
rscript()
is now deprecated; use rcode()
instead.compileLaTeX()
will give an error if the filename extension is neither *.tex nor *.ltx (case sensitive). The reason for this is that it is only those that are recognized by the underlying texi2dvi
script (if a different filename extension is used, texi2dvi
will use texinfo
instead of latex
to compile the document which for obvious reasons will not compile; texinfo files are not LaTeX files). I’d like to thank Kurt Hornik at CRAN for helping me troubleshoot this as I incorrectly had a static LaTeX vignette named *.latex.Now all %\VignetteKeyword{}
entries inside a meta directives with language ‘R-vignette’ are parsed into meta data field keywords
.
Added arguments header
and metadata
to compileMarkdown()
.
Now the processor function returned by findProcessor()
passes meta data as a named list to the underlying compiler/processor.
Now the full RspFileProduct
object is passed to postprocessors rather than its barebone pathname.
rsource
, rfile
, and rcat
moved to system.file("exec", package = "R.rsp")
. These scripts are convenient wrappers that use Rscript
internally.isCapableOf()
for "asciidoc"
and "pandoc"
would given an error (instead of FALSE) if the binary was not found.Now the LaTeX processor returned by findProcess()
for RspFileProduct
(with content type application/x-tex
or application/x-latex
) will add the directory of the source file to the TEXINPUTS
.
Added RSP preprocessing directives <%@ifdef ...%>
and <%@ifndef ...%>
which are shorts for <@if test="exists" ...%>
and it’s negated form.
CLEANUP/ROBUSTNESS: As part of deprecating the old R.rsp (<= 0.8.2) API, the following steps have been taken:
S3 methods are no longer exported. Only the generics.
Methods flush()
and stop()
part of the old RSP API no longer mask corresponding functions of the base package.
Several methods including those in the built-in Tcl httpd server no longer assumes that the R.rsp package is attached. They are also prepared for not all methods being exported (which may happen in a future release).
x='y'
and x="y"
ones, e.g. x=.y.
, x=|y|
, and so on. Furthermore, paired brackets may also be used, e.g. x={y}
, x=[y]
, x=<y>
and x=(y)
, and then also in matched replicates, e.g. x={{{y}}}
. Added several package system tests for this.rcompile()
can write to file and if the input is a file, then it does so by default.Now rscript()
can write to file and if the input is a file, then it does so by default.
Now metadata source
, which is a reference to the source of the RSP document, is set whenever possible/known. It is considered a “local” metadata attribute, meaning it will not be part of any generated source code scripts, because those should be the same regardless of where the source is located.
Using R.utils::use()
instead of require()
in more places.
Cleanup: Dropped internal ununsed vignette engines.
Bumped up package dependencies.
USABILITY: The error messages thrown on RSP code chunks with syntax errors now also display the beginning and the end of the actual code chunk making it easier to identify/locate it.
Cleanup: Now rspWeave()
and hence the rsp::rsp
vignette engine cleans up intermediate files (e.g. Markdown and TeX) produced while compiling the vignette into its final output (HTML or PDF).
rfile()
now assumes an RSP document when it cannot infer the type from the filename etc.R.utils::use()
instead of library()
in more RSP documents.Now all rfile()
also works with URLs for all known processors, e.g. rfile("http://latex-project.org/guides/usrguide.tex")
and rfile("https://raw.github.com/yihui/knitr-examples/master/001-minimal.Rmd")
. Added package system tests for various types of “online” compilation.
Now rspTangle()
passes ...
to rsource()
.
compileLaTeX()
cleans up and shortens LaTeX environment variables (e.g. TEXINPUTS
) iff possible, before compiling the document. This lowers the risk for compilation failures due to too long search paths.compileLaTeX()
tries to shorten any paths as far as possible, e.g. ../foo/../foo/
to ../foo/
to workaround possible length limits of the TeX compiler. It now also adds a symbolic link to TEXINPUTS
that refers to the directory of the LaTeX file.browseURL(..., browser = NULL)
, which in turn utilizes shell.exec()
, view()
for RspFileProduct
failed to open files in subdirectories, because they had forward slashes in their pathname, e.g. reports/main.html. By temporarily changing the working directory to that of the file, view()
now opens the file properly.print()
for RspFileProduct
reports file sizes also in kB, MB, etc.rstring()
and rfile()
for RSP expression that outputted a large amount of text to the output document. Internally, this was achieved by replacing the default capturing of output, which uses text connections, with one that uses raw connections instead. The processing time for the former was exponential in the number of captured lines whereas for the latter it is linear.rcat()
, rfile()
, etc. from the command line with arguments, e.g. Rscript -e R.rsp::rfile LoremIpsum.md.rsp
and Rscript -e R.rsp::rcat "Random number: <%= sample(1) %>"
. Also, by setting alias rcat="Rscript -e R.rsp::rcat"
, etc. one can then just call rcat "Random number: <%= sample(1) %>"
.R.oo::ll()
used really only by verbose statements trigger the attachment of the R.oo package (as of R.oo (>= 1.17.0)), which in turn outputs a few package startup messages. Thus calling, say, R.rsp::rcat()
would output such messages (which would be surprising to the user). To lower this impact, ll()
is only called when verbose is enabled.compileLaTeX()
adds the directory of the LaTeX file to TEXINPUTS
also by its relative path (in addition to its absolute path). This provides a workaround for systems that does not handle TEXINPUTS
paths that are too long.rfile()
also supports filename substitution based on whisker / Mustache-like variable substitution, i.e. {{<variable>}}
.Added !()
for RspProduct
, which is a shortcut for view()
.
Now the code generated by RspRSourceCodeFactory
provides a rmeta()
function for getting and setting document metadata.
Now rfile()
accepts also non-RSP documents, e.g. rfile("report.md")
, rfile("report.Rnw")
, and rfile("report.tex")
. This also means that all RSP documents must use the *.rsp filename extension in order for rfile()
to automatically recognize it as RSP. To process files with custom extensions as RSP, do rfile(RspFileProduct("report.custom", type = "application/x-rsp"))
.
Now getType()
for RspFileProduct
works also for URLs.
compileRsp()
did not acknowledge argument postprocess
.rfile()
tries to rename the generated output file, iff its filename can be renamed using variable substitutions. For instance, rfile('${foo}.txt.rsp')
will try to rename output file ${foo}.txt
to SampleA.txt
, if variable foo
is set to say SampleA
(either globally or by the RSP document). If the variable is not set, the output file will remain ${foo}.txt
. Requires R.utils (>= 1.28.6).compileRsp(..., postprocess = TRUE)
would throw ‘Error in UseMethod(“process”): no applicable method for ’process’ applied to an object of class “character”’. Added system test for compileRsp()
.rsp::rsp
engine postprocesses the RSP document by default. This means that RSP-embedded Markdown vignettes will be turned into HTML documents just as RSP-embedded LaTeX vignettes will become PDF documents. It also means that such engines will no longer rely on the R tools package to compile TeX output into PDFs.autoload()
:s.rsource()
would not evaluate in the current environment. Added a package system test for this.md.rsp+knitr:pandoc
vignette engine suppresses messages generated by knitr::pandoc()
.browseRsp()
demo page assumed that R.utils was attached.rsource()
command to ‘RSP Markup Language - Reference Card’ vignette’. Adjusted the other two vignettes to reflect usage of vignettes/.No isCapableOf()
also supports version specifications.
Now the R.rsp
Package
object is also available when the package is only loaded (but not attached).
The ‘Dynamic document creation using RSP’ vignette assumed that evalCapture()
of R.utils was on the search path.
ROBUSTNESS: Now the ‘Introductory slides on RSP’ vignette better detects what version of pandoc
is available and adapts accordingly. If not available, the fallback Markdown version will display a note about this. Thanks to Brian Ripley for reporting on pandoc
version incompatibilities.
Changed how vignette engines are registered so that if an error occurs, it is no longer silently ignored.
ROBUSTNESS: Forgot to import R.methodsS3::appendVarArgs()
.
preprocess()
of RspDocument
also records R vignette meta data engine
(from %\VignetteEngine{}
) and RSP custom tangle
(from %\VignetteTangle{}
).Updated the ‘Dynamic document creation using RSP’ vignette with information on how to embedded image files as data URI into HTML and Markdown.
Added HTML vignette ‘Introductory slides on RSP’. This requires that the package suggests the R.devices, base64enc and knitr packages.
start()
for HttpDaemon
makes sure that the R.rsp package is attached so that the Tcl HTTP daemon have access to its methods.WORKAROUND: For now, package attaches the R.oo package. This is needed due to what appears to be a bug in how R.oo finalizes Object
:s assuming R.oo is/can be attached. Until that is resolved, we make sure R.oo is attached.
Two of the package vignettes assumed that the R.rsp package would be attached.
buffered
to rcat()
. If FALSE and output is sent to standard output, then RSP output is forwarded to standard output as they appear (and the underlying engine allow for it).tidy()
for RspRSourceCode
would not drop the last line of the header leaving a long ## - - - - ...
comment line at top.rpaste()
before being outputted via cat()
. This makes it possible (i) to override the default and (ii) to define class specific behaviors from within the RSP document itself.TEXINPUTS
directory done by compileLaTeX()
needed to add its absolute (not relative) path.clean
all the way down to compileLaTeX()
via rfile()
, e.g. rfile("foo.tex.rsp", clean = TRUE)
.ROBUSTNESS: Updated system tests to not use commas in LaTeX file paths, because such are not supported on all file systems.
ROBUSTNESS: If compileLaTeX()
was called on a LaTeX file in a directory different than the working directory, it could fail to located files to be included (e.g. image files). In order to make this less likely to happen, compileLaTeX()
now adds the the directory of the compiled LaTeX file to the TEXINPUTS
search path, iff it is different than the working directory.
rfile()
also for RspString
, RspDocument
and RspRSourceCode
.rm()
calls with NULL assignments.Several updates to browseRsp()
:
It automatically adds the current directory (‘.’) as well as a ‘./rsp’ subdirectory to the list of known root paths.
R.rsp::browseRsp()
works without loading the package first.
It can be used to open any RSP file by specifying it’s (absolute or relative) pathname, e.g. browseRsp("foo/bar.html.rsp")
and browseRsp("foo/bar.md.rsp")
.
Added argument trim=FALSE
to getParameter()
and getParameters()
for HttpRequest
.
processRsp()
for HttpDaemon
with version="1.0.0"
utilizes rfile()
rather than rstring()
so that postprocessors are also applied. Also, the rfile()
working directory is set to the current directory (and not the directory of the source file as with version = "0.1.0"
). For backward compatibility with old RSP pages, write()
for HttpDaemonRspResponse
now supports the new RSP engine as well. This will simplify the transition.rfile()
handles files with only one filename extension.The internal RSP engine has undergone a major redesign.
BACKWARD COMPATIBILITY: The RSP processor of the built-in HTTP daemon is by default still using the previous RSP engine. Note, the built-in HTTP daemon is only there as a proof of concept and is not recommended for other than toy examples.
Added compileRnw()
which compiles Sweave and knitr Rnw files.
Added typeOfRnw()
which tries to infer whether an Rnw file is for Sweave or knitr based on its contents.
compileKnitr()
, compileRnw()
, and rsp()
for handling Sweave and knitr Rnw files.Now rsp()
uses compileRnw()
for *.Rnw files.
Added knitr under suggested packages.
outPath
to compileLaTeX()
, compileSweave()
, and rsp()
, which is also the working directory.compileLaTeX()
, compileSweave()
and rsp()
.compileLaTeX()
and compileSweave()
would return an incorrect pathname unless the source file was in the working directory..Internal()
.toLatex()
for LaTeX escaping character strings, cf. utils::toLatex()
for sessionInfo
objects.%\VignetteSource{}
and %\VignetteBuild{}
. See inst/doc/ of this package for more details.write <- R.rsp::write
at the beginning, to assure that it is used instead of base::write()
.restart()
, which has been dropped. This was a non-critical error and the fix was trivial.HttpDaemon$getRootPaths()
did not handle paths with spaces correctly. Added a getRootPaths()
Tcl function to instead handle this, which is called by the former.sourceWithTrim()
no longer uses partial argument when calling source()
.clean
and quiet
to compileLaTeX()
.browseRsp()
pass ...
arguments to browseURL()
.rsp(text = "...")
would throw ‘Error …: unused argument(s) (fileext = ".txt.rsp"
)’. Solved by providing a patched tempfile()
with this feature for R v2.12.x. Thanks Uwe Ligges for spotting this.Added rsp()
.
Added compileLaTeX()
and compileSweave()
.
Changed RSP preprocess directives to have format <%#insert ...%>
.
RSP PAGES: Now the ‘R Server Pages’ page launched by browseRsp()
list only the first package installation in case a package occurs in multiple package libraries in .libPaths()
.
RSP PAGES: Added a demo page listing all built-in colors in R.
write()
for RspResponse
classes would ignore arguments collapse
and sep
.Now the trimming of RSP handles all newline types, i.e. LF, CR+LF, and CR. The corresponding argument trimRsp
now defaults to TRUE everywhere.
Cleanup: Some minor R code cleanups.
browseRsp()
would list package twice on a Windows system.getParameter()
of HttpRequest
to return all values of a query parameter with multiple entries. Added argument drop
.getHttpRequest()
of HttpDaemon
would drop all but the last of replicated query parameters of the same name, which for instance may occur if an HTML form with replicated check boxes is used. Thanks to Truc Trung at University of Bergen, Norway, for this report.Now rsptex()
trims white space of RSP blocks so that RSP-only blocks no longer introduces newlines (that previously had to be escaped).
Added argument trimRsp
to parseRsp()
for trimming white spaces surrounding RSP blocks that have preceding and succeeding white space and that are followed by a newline. Currently it defaults to FALSE, but this may change in a future release. The same was added to old translateRspV1()
for compatibility reasons. Note, compileRsp()
and sourceRsp()
will pass this argument down to these functions via ...
.
Added rsptex()
to compiling a *.tex.rsp file into a *.dvi file via *.tex.rsp -> *.tex.rsp.R -> *.tex -> *.dvi.
Added compileRsp()
, which utilizes internal translateRsp()
which in turn calls parseRsp()
.
a-Z
is illegal on (at least) some locale, e.g. ‘C’ (where A-z
works). The only way to specify the ASCII alphabet is to list all characters explicitly, which we now do in all methods of the package. See the r-devel thread “invalid regular expression ‘[a-Z]’” on 2008-03-05 for details.Replaced gsub pattern "\\\[\"\']"
with "\\\\[\"\']"
in indexOfNonQuoted()
.
Replace regexpr pattern "^[ \]*=[ \]*"
with "^[ \]*=[ \]*"
in translateRsp()
.
Packages with an rsp/ path (installed from inst/rsp/) will now be listed and linked to on the main RSP page. This makes it very easy to add RSP pages to a package. For an example, see the aroma.light package.
Added browseRsp()
for the Package
too, e.g. browseRsp(aroma.light)
. Added help pages for these methods.
When calling browseRsp(start = TRUE)
, (the parents of) all library paths are now added to the root paths.
translateRsp("\\\n")
would convert to "\\n"
. Thanks Peter Dahlsgaard for the suggestion how to fix it using deparse()
.
translateRsp()
would replicate last R code or text piece, for each RSP comment tag.
getParameters()
to HttpRequest
for completeness.Added writeResponse()
to HttpDaemon
. No other classes but HttpDaemon
should know about the Tcl HTTP daemon.
Improved the built-in RSP pages.
file://
) when clicking on links on a page that has been loaded via HTTP. This makes it impossible (for now) to link to local R help pages via RSP pages (without passing everything through the HTTP daemon that is). It works under Internet Explorer.Create better support for plugins on the main RSP page.
Added argument overwrite
to sourceAllRsp()
.
Added argument overwrite
to constructor of RspResponse
.
example(HttpDaemon)
so it actually runs and opens up the main RSP page (when in interactive mode).translateRsp()
would in some locales give the error: “simpleError in gsub(pattern, replacement, x, ignore.case, extended, fixed): ‘replacement’ is invalid in this locale”. This was due to an incorrect internal MAGIC.STRING
. Thanks Julien Gagneur at EMBL/HTFG Center, Heidelberg for this bug fix.