xg_linkify: Add and remove links in an unpacked xlsx directory

View source: R/xg_linkify.R

xg_linkifyR Documentation

Add and remove links in an unpacked xlsx directory

Description

Things that make an unpacked xlsx less awful to navigate in the browser:

  • Each directory has index.html, listing links to files/subdirectories

  • Links to subdirectories link to the associated index.html

  • XML files that do not have .xml as file extension are copied to a file having the same name, but with the extension .XML added and this is what is linked.

Usage

xg_linkify(path)

xg_de_linkify(path)

Arguments

path

Path to a directory corresponding to a single, unpacked xlsx, i.e. the output of xg_unzip() or, alternatively, a directory of such things.

Details

xg_linkify() does the above and xg_de_linkify() undoes it.

Examples

file.copy(xg_example("datasets"), "datasets.xlsx")
res <- "datasets.xlsx" %>%
  xg_unzip() %>%
  xg_linkify()
xg_browse(res)

xg_de_linkify("datasets")

## clean up
unlink("datasets", recursive = TRUE)
file.remove("datasets.xlsx")

jennybc/excelgesis documentation built on July 29, 2023, 4:31 a.m.