Skip to contents

Creates an HTML representation of a WaniKani character (radical, kanji, or vocabulary) similar to the WaniKani website display, including type, meanings, readings, and related kanji. The result can be viewed directly in RStudio Viewer.

Usage

wk_create_character_card(
  character,
  text_only = FALSE,
  reload = FALSE,
  api_key = NULL,
  view = TRUE
)

Arguments

character

Character string of the Japanese character to display

text_only

Logical indicating whether to show similar kanji as text only (default: FALSE)

reload

Logical indicating whether to reload subjects data from API (default: FALSE)

api_key

Optional API key (uses environment variable if not provided)

view

Logical indicating whether to display in RStudio Viewer (default: TRUE)

Value

htmltools HTML object that can be displayed in RStudio Viewer or RMarkdown

Examples

if (FALSE) { # \dontrun{
# Create and view HTML card for water kanji in RStudio
wk_create_character_card("水")

# Create without viewing (for embedding in documents)
html_card <- wk_create_character_card("水", view = FALSE)

# Text-only similar kanji
wk_create_character_card("水", text_only = TRUE)

# Force reload subjects data
wk_create_character_card("水", reload = TRUE)
} # }