Skip to content

litedown 0.10

Latest

Choose a tag to compare

@yihui yihui released this 11 Jul 13:23
· 1 commit to main since this release
  • 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 with litedown:::proj_skeleton(path, type), where type is "book" or "site" (thanks, @jangorecki, #97).

  • Added fuse_exit(), which can be called inside a code chunk to exit fuse() early and discard the rest of the document. It takes an optional append argument 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 to TRUE and the tinyimg package is installed, PNG images generated from code chunks will be optimized by tinyimg::tinypng() to reduce file size. For other PNG files (e.g., images manually included in the document), users can call tinyimg::tinypng('.') to optimize all PNG files under the current directory (thanks, @bastistician, #116).

  • Added new engines exec, sh, bash, zsh, and powershell to run arbitrary commands via system2() and capture the output. The exec engine requires the chunk option command; the sh/bash/zsh/powershell engines use the engine name as the command.

  • When the output argument of mark() is a .pdf file, Markdown will be converted to a full .tex file 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 lang for HTML output, which is the language of the document (e.g., en-US for 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 the lang field under meta in YAML metadata, e.g., lang: en-GB for 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 containing index.html (e.g., playground/index.html), so subdirectory index pages appear in the navigation.

  • Fixed a re-entrancy bug that chunk options fig.path and cache.path in nested fuse() calls caused overridden figure/cache files (thanks, @nanxstats, #127).

  • Fixed a bug that detect_pkg() doesn't work when R CMD check checks package vignettes.