-
Added minimal book and website project templates that can be discovered by RStudio from
File>New Project>New Directory>Project using litedown. You can also create them programmatically withlitedown:::proj_skeleton(path, type), wheretypeis"book"or"site"(thanks, @jangorecki, #97). -
Added
fuse_exit(), which can be called inside a code chunk to exitfuse()early and discard the rest of the document. It takes an optionalappendargument to add text after the current chunk (thanks, @TimTaylor, #117). -
Added support for optimizing PNG plot files via the global option
litedown.tinypng. When set toTRUEand the tinyimg package is installed, PNG images generated from code chunks will be optimized bytinyimg::tinypng()to reduce file size. For other PNG files (e.g., images manually included in the document), users can calltinyimg::tinypng('.')to optimize all PNG files under the current directory (thanks, @bastistician, #116). -
Added new engines
exec,sh,bash,zsh, andpowershellto run arbitrary commands viasystem2()and capture the output. Theexecengine requires the chunk optioncommand; thesh/bash/zsh/powershellengines use the engine name as the command. -
When the
outputargument ofmark()is a.pdffile, Markdown will be converted to a full.texfile instead of a LaTeX fragment before it is compiled to PDF. -
Fixed a bug that sections in the appendix could not be cross-referenced.
-
Added a meta variable
langfor HTML output, which is the language of the document (e.g.,en-USfor US English). This variable is used in the<html lang="...">tag of the HTML output file. By default, the language is detected from the system locale, but you can also set it via thelangfield undermetain YAML metadata, e.g.,lang: en-GBfor British English (thanks, @TimTaylor, #121). -
Fixed a bug when embedding JS resources: previously
</was escaped to<\/to avoid</script>from being present in the JS source, but the escaping was too general (e.g.,</may appear in a regex/</g). Now we only escape</script>to<\/script>. -
For
fuse_site(), the generated site menu now automatically includes landing pages for one-level subdirectories containingindex.html(e.g.,playground/index.html), so subdirectory index pages appear in the navigation. -
Fixed a re-entrancy bug that chunk options
fig.pathandcache.pathin nestedfuse()calls caused overridden figure/cache files (thanks, @nanxstats, #127). -
Fixed a bug that
detect_pkg()doesn't work whenR CMD checkchecks package vignettes.