| Title: | Lightweight Output Formats for 'litedown' |
|---|---|
| Description: | A collection of lightweight, minimalist output formats and templates for 'litedown' by Xie (2026) <doi:10.32614/CRAN.package.litedown>, including resumes, cover letters, and other common document types. Documents are rendered with HTML and CSS and can be printed to PDF with a 'Chromium'-based browser, without requiring 'Pandoc' or a 'LaTeX' installation. |
| Authors: | Nan Xiao [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-0250-5673>), Yihui Xie [ctb, cph] (pages.js and pages.css libraries), Ayuhito [ctb, cph] (google-font-metadata catalog) |
| Maintainer: | Nan Xiao <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.0 |
| Built: | 2026-10-14 06:35:08 UTC |
| Source: | https://github.com/nanxstats/liteformats |
Render a two-column cover letter to self-contained HTML or PDF. The narrow left column holds the sender's details, while the letter remains the visual foreground in the wider right column.
cover_letter( input, output = NULL, options = cover_letter_options(), envir = parent.frame() )cover_letter( input, output = NULL, options = cover_letter_options(), envir = parent.frame() )
input |
Path to a |
output |
Output path ending in |
options |
A cover letter configuration created by
|
envir |
Environment in which R code in |
The normalized output path, invisibly.
source <- use_cover_letter(tempfile(fileext = ".Rmd")) cover_letter(source, tempfile(fileext = ".html")) ## Not run: # PDF output requires a local Chromium-based browser cover_letter(source, "cover-letter.pdf") ## End(Not run)source <- use_cover_letter(tempfile(fileext = ".Rmd")) cover_letter(source, tempfile(fileext = ".html")) ## Not run: # PDF output requires a local Chromium-based browser cover_letter(source, "cover-letter.pdf") ## End(Not run)
Create a classed options object for cover_letter(). Settings work in the
same way as resume_options(), with letter-specific metadata replacing the
resume-specific fields.
cover_letter_options( author = NULL, address = NULL, phone = NULL, email = NULL, website = NULL, date = NULL, greeting = NULL, font_family = NULL, google_font = NULL, font_files = NULL, font_size = NULL, font_scale = NULL, ligatures = NULL, line_height = NULL, paragraph_spacing = NULL, section_spacing = NULL, margins = NULL, paper = NULL, link_color = NULL, paged = NULL, keep_html = FALSE, browser = NULL )cover_letter_options( author = NULL, address = NULL, phone = NULL, email = NULL, website = NULL, date = NULL, greeting = NULL, font_family = NULL, google_font = NULL, font_files = NULL, font_size = NULL, font_scale = NULL, ligatures = NULL, line_height = NULL, paragraph_spacing = NULL, section_spacing = NULL, margins = NULL, paper = NULL, link_color = NULL, paged = NULL, keep_html = FALSE, browser = NULL )
author, address, phone, email, website
|
Contact metadata. |
date, greeting
|
Letter date and salutation. |
font_family |
A CSS |
google_font |
A Google Fonts family name or a full Google Fonts CSS v2 URL. This is an explicit online resource and is never used by default. A family name loads the available weights and styles needed for regular, bold, italic, and bold italic text, preferring a variable weight range. Supply a full URL to select other weights, axes, or options. |
font_files |
A named character vector or list of local font files. Names
may be |
font_size |
A CSS length such as |
font_scale |
A positive number used to scale |
ligatures |
Whether to enable common and discretionary ligatures.
The template default is |
line_height |
A positive unitless CSS line height or CSS length. |
paragraph_spacing, section_spacing
|
CSS lengths controlling vertical rhythm. |
margins |
Page margins. Supply one to four CSS lengths using standard CSS shorthand order, or numeric values interpreted as inches. |
paper |
A paper name ( |
link_color |
Any valid CSS color. |
paged |
Whether the HTML preview should open in a paginated layout. Printing always invokes the packaged pages.js pagination. |
keep_html |
For PDF output, whether to retain the intermediate HTML
beside the PDF. Defaults to |
browser |
Path to Chromium, Google Chrome, or Microsoft Edge. |
A liteformats_cover_letter_options object for the options
argument of cover_letter().
Use the same flat, kebab-case liteformats mapping documented in
resume_options(). Place cover-letter metadata such as author, address,
date, and greeting at the top level of the YAML header. Unknown
liteformats YAML names are rejected.
cover_letter_options( greeting = "Dear Search Committee:", paragraph_spacing = "0.9em" )cover_letter_options( greeting = "Dear Search Committee:", paragraph_spacing = "0.9em" )
Embed one or more local graphic files as base64 data URIs and return raw
HTML that litedown::fuse() can include directly in a document. This keeps
the rendered document self-contained without copying image files beside the
source or output.
include_graphics(path, alt = "", class = NULL)include_graphics(path, alt = "", class = NULL)
path |
A character vector of paths to local graphic files. |
alt |
Alternative text. Supply one string for all graphics or one string per path. |
class |
An optional CSS class string added to every image. |
Raw HTML output for use in a litedown code chunk.
signature <- system.file( "liteformats/skeletons/signature.png", package = "liteformats" ) include_graphics( signature, alt = "Handwritten signature", class = "signature" )signature <- system.file( "liteformats/skeletons/signature.png", package = "liteformats" ) include_graphics( signature, alt = "Handwritten signature", class = "signature" )
Render a Markdown or R Markdown resume to a self-contained HTML document or
to PDF through a headless Chromium-based browser. The output format is
inferred from the extension of output.
resume( input, output = NULL, options = resume_options(), envir = parent.frame() )resume( input, output = NULL, options = resume_options(), envir = parent.frame() )
input |
Path to a |
output |
Output path ending in |
options |
A resume configuration created by |
envir |
Environment in which R code in |
Document metadata and typographic settings may be supplied in the YAML
header. Values in options take precedence over YAML. See resume_options()
for function-call configuration and use_resume() for a complete starter.
The normalized output path, invisibly.
source <- use_resume(tempfile(fileext = ".Rmd")) resume(source, tempfile(fileext = ".html")) ## Not run: # PDF output requires a local Chromium-based browser resume(source, "resume.pdf") # Embed local font files resume( source, options = resume_options( font_files = c( regular = "fonts/MySerif-Regular.woff2", italic = "fonts/MySerif-Italic.woff2", bold = "fonts/MySerif-Bold.woff2" ), font_scale = 0.96, ligatures = FALSE ) ) ## End(Not run)source <- use_resume(tempfile(fileext = ".Rmd")) resume(source, tempfile(fileext = ".html")) ## Not run: # PDF output requires a local Chromium-based browser resume(source, "resume.pdf") # Embed local font files resume( source, options = resume_options( font_files = c( regular = "fonts/MySerif-Regular.woff2", italic = "fonts/MySerif-Italic.woff2", bold = "fonts/MySerif-Bold.woff2" ), font_scale = 0.96, ligatures = FALSE ) ) ## End(Not run)
Create a classed options object for resume(). The helper keeps secondary
metadata, typography, page, and PDF controls out of the main rendering
function while retaining argument-name checking and autocomplete.
resume_options( author = NULL, job_title = NULL, address = NULL, phone = NULL, email = NULL, website = NULL, linkedin = NULL, font_family = NULL, google_font = NULL, font_files = NULL, font_size = NULL, font_scale = NULL, ligatures = NULL, line_height = NULL, paragraph_spacing = NULL, section_spacing = NULL, margins = NULL, paper = NULL, link_color = NULL, paged = NULL, keep_html = FALSE, browser = NULL )resume_options( author = NULL, job_title = NULL, address = NULL, phone = NULL, email = NULL, website = NULL, linkedin = NULL, font_family = NULL, google_font = NULL, font_files = NULL, font_size = NULL, font_scale = NULL, ligatures = NULL, line_height = NULL, paragraph_spacing = NULL, section_spacing = NULL, margins = NULL, paper = NULL, link_color = NULL, paged = NULL, keep_html = FALSE, browser = NULL )
author, address, phone, email, website
|
Contact metadata. |
job_title, linkedin
|
Resume-specific professional and contact metadata. |
font_family |
A CSS |
google_font |
A Google Fonts family name or a full Google Fonts CSS v2 URL. This is an explicit online resource and is never used by default. A family name loads the available weights and styles needed for regular, bold, italic, and bold italic text, preferring a variable weight range. Supply a full URL to select other weights, axes, or options. |
font_files |
A named character vector or list of local font files. Names
may be |
font_size |
A CSS length such as |
font_scale |
A positive number used to scale |
ligatures |
Whether to enable common and discretionary ligatures.
The template default is |
line_height |
A positive unitless CSS line height or CSS length. |
paragraph_spacing, section_spacing
|
CSS lengths controlling vertical rhythm. |
margins |
Page margins. Supply one to four CSS lengths using standard CSS shorthand order, or numeric values interpreted as inches. |
paper |
A paper name ( |
link_color |
Any valid CSS color. |
paged |
Whether the HTML preview should open in a paginated layout. Printing always invokes the packaged pages.js pagination. |
keep_html |
For PDF output, whether to retain the intermediate HTML
beside the PDF. Defaults to |
browser |
Path to Chromium, Google Chrome, or Microsoft Edge. |
Every argument defaults to NULL unless stated otherwise. A NULL metadata
or appearance value falls back to the source document's YAML header and then
to the template default. Values supplied here take precedence over YAML.
A liteformats_resume_options object for the options argument of
resume().
In a source document, place metadata at the top level of the YAML header and
appearance controls in one flat liteformats mapping. YAML setting names
are the kebab-case equivalents of the helper arguments:
author: "Jane Doe" job-title: "Research Scientist" liteformats: paper: letter margins: ["0.65in", "0.8in"] font-family: "Charter, Georgia, serif" font-size: 11pt font-scale: 0.94 ligatures: false line-height: 1.15 paragraph-spacing: 0.05em section-spacing: 1em link-color: "#385898" paged: true
Unknown liteformats YAML names are rejected to catch misspellings.
resume_options( font_size = "10.5pt", margins = c("0.6in", "0.75in"), paged = FALSE )resume_options( font_size = "10.5pt", margins = c("0.6in", "0.75in"), paged = FALSE )
Copy an editable R Markdown starter document to path. Static assets used by
the rendered formats remain inside the installed package and are referenced
from the copied source instead of being copied beside it.
use_resume(path = "resume.Rmd", overwrite = FALSE) use_cover_letter(path = "cover-letter.Rmd", overwrite = FALSE)use_resume(path = "resume.Rmd", overwrite = FALSE) use_cover_letter(path = "cover-letter.Rmd", overwrite = FALSE)
path |
Destination path. |
overwrite |
Whether to replace an existing file. |
The normalized destination path, invisibly.
use_resume(tempfile(fileext = ".Rmd")) use_cover_letter(tempfile(fileext = ".Rmd"))use_resume(tempfile(fileext = ".Rmd")) use_cover_letter(tempfile(fileext = ".Rmd"))