Skip to contents

Render gloss from a dataframe

Usage

gloss_df(df, output_format = config$output, numbering = config$numbering)

Arguments

df

Dataframe one row per gloss. Columns translation, source and label have special meaning (see as_gloss()); all the others will be interpreted as lines to align in the order given.

output_format

(Optional) Whether it will use latex, word or html format.

numbering

(Optional) Whether the gloss should be numbered (in Word and HTML).

Value

Object of class gloss with the original input as data attribute.

Examples

my_gloss <- data.frame(
  first_line = "my first line",
  second_line = "my second line",
  translation = "Translation of my example",
  label = "label"
)
gloss_df(my_gloss)
#> [1] "(@label) _my_ _first_ &nbsp; &nbsp;_line_ \n\n    my &nbsp;second line &nbsp; \n\n    'Translation of my example'"
#> attr(,"class")
#> [1] "gloss"     "character"
#> attr(,"data")
#>      first_line    second_line               translation label
#> 1 my first line my second line Translation of my example label