Skip to contents

Format and print author entries from the milestones database as text, HTML, or markdown.

Usage

print_author(aut, result = c("text", "html", "md", "markdown"))

Arguments

aut

A data frame from the authors() table (one or more rows), or a numeric vector of author IDs (aid) to look up

result

Output format: "text" for plain text (default), "html" for HTML formatted output, or "md"/"markdown" for markdown format

Value

A character vector with the formatted author entries (invisibly). The formatted entries are also printed to the console.

Details

The function formats author information including name, birth/death places and dates, and notes. Missing values are handled gracefully.

If multiple authors are provided (either as multiple rows or multiple IDs), each author is printed on a separate line with a blank line between them.

Examples

if (FALSE) { # \dontrun{
# Get authors and print the first one
aut <- authors()
print_author(aut[1, ])

# Print multiple authors
print_author(aut[1:3, ])

# Print as HTML
print_author(aut[1, ], result = "html")

# Print as markdown
print_author(aut[1, ], result = "md")

# Look up by author ID
print_author(2)

# Look up multiple IDs
print_author(c(2, 3, 4))
} # }