write_board_manifest: Write board manifest file to board's root directory

View source: R/board.R

write_board_manifestR Documentation

Write board manifest file to board's root directory

Description

A board manifest file records all the pins, along with their versions, stored on a board. This can be useful for a board built using, for example, board_folder() or board_s3(), then served as a website, such that others can consume using board_url(). The manifest file is not versioned like a pin is, and this function will overwrite any existing ⁠_pins.yaml⁠ file on your board. It is your responsibility as the user to keep the manifest up to date.

Some examples are provided in vignette("using-board-url").

Usage

write_board_manifest(board, ...)

Arguments

board

A pin board that is not read-only.

...

Additional arguments passed on to methods for a specific board.

Details

This function is not supported for read-only boards. It is called for the side-effect of writing a manifest file, ⁠_pins.yaml⁠, to the root directory of the board. (This will not work in the unlikely event that you attempt to create a pin called "_pins.yaml".)

The behavior of the legacy API (for example, pin_find()) is unspecified once you have written a board manifest file to a board's root directory. We recommend you only use write_board_manifest() with modern boards.

Value

The board, invisibly

Examples

board <- board_temp()
pin_write(board, mtcars, "mtcars-csv", type = "csv")
pin_write(board, mtcars, "mtcars-json", type = "json")

write_board_manifest(board)

# see the manifest's format:
fs::path(board$path, "_pins.yaml") %>% readLines() %>% cat(sep = "\n")

# if you write another pin, the manifest file is out of date:
pin_write(board, 1:10, "nice-numbers", type = "json")

# you decide when to update the manifest:
write_board_manifest(board)


pins documentation built on Oct. 7, 2024, 5:07 p.m.