Learn R Programming

pensar (version 0.4.2)

ingest: Source ingestion

Description

Ingest content into a pensar vault. Ingest content into the vault

Writes content to raw/{type}/, generates a filename from source and date, adds YAML frontmatter, updates index.md, and appends to log.md.

Usage

ingest(content, type = c("articles", "chats", "briefings", "matrix"), source,
       title = NULL, tags = NULL, vault = default_vault())

Value

The path to the written file, invisibly.

Arguments

content

Character string or character vector (lines) of content.

type

Content type: "articles", "chats", "briefings", or "matrix".

source

Short identifier for the content source (e.g., URL, session ID, project name).

title

Optional title. If NULL, derived from source.

tags

Optional character vector of tags.

vault

Path to the vault directory.

Examples

Run this code
v <- tempfile("vault-")
init_vault(v, rproj = FALSE, agent_instructions = FALSE)
ingest("Hello, world.", type = "articles", source = "demo",
       vault = v)
status(v)
unlink(v, recursive = TRUE)

Run the code above in your browser using DataLab