---
title: "Excel structure for `title_footer_decorator`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Excel structure for `title_footer_decorator`}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
```

This vignette documents the exact structure expected by `title_footer_decorator()` for the Excel specification file.
The decorator expects a sheet that lists table identifiers and, for each table,
a `TITLE` row and zero or more `FOOTNOTE` rows.

The function expects the titles to be in the first sheet named `Sheet1`. The column names must be the first
row of the file (i.e. `TABLE ID`, `IDENTIFIER`, `TEXT`).

Below is an example of a table that would work for the decorator. The `DO_NOT_DELETE` values in the first row
are intentional and have to be part of the file.

```{r required-columns, echo = TRUE}
example_excel <- data.frame(
  `TABLE ID` = c(
    "DO_NOT_DELETE",
    "TSFAE01A", "TSFAE01A", "TSFAE01A", "TSFAE01A", "TSFAE01A", "TSFAE01A", "TSFAE01A",
    "TSFAE01B", "TSFAE01B", "TSFAE01B", "TSFAE01B", "TSFAE01B", "TSFAE01B", "TSFAE01B"
  ),
  IDENTIFIER = c(
    "DO_NOT_DELETE",
    "TITLE", "FOOTNOTE1", "FOOTNOTE2", "FOOTNOTE3", "FOOTNOTE4", "FOOTNOTE5", "FOOTNOTE6",
    "TITLE", "FOOTNOTE1", "FOOTNOTE2", "FOOTNOTE3", "FOOTNOTE4", "FOOTNOTE5", "FOOTNOTE6"
  ),
  TEXT = c(
    "DO_NOT_DELETE",
    "Some title", "First part of footnote", "Another part of footnote", "Another part of footnote",
    "Another part of footnote", "Another part of footnote", "Another part of footnote",
    "Some title", "First part of footnote", "Another part of footnote", "Another part of footnote",
    "Another part of footnote", "Another part of footnote", "Another part of footnote"
  ),
  stringsAsFactors = FALSE,
  check.names = FALSE
)

knitr::kable(example_excel)
```
