These functions are output-specific and can be used to check the specific output
of certain calls, but are not meant to be used in an R Markdown file. Instead,
use as_gloss()
or gloss_df()
.
Usage
gloss_pdf(gloss)
gloss_html(gloss, numbering = TRUE)
gloss_tooltip(gloss, numbering = TRUE)
gloss_leipzig(gloss, numbering = TRUE)
gloss_word(gloss, numbering = TRUE)
Arguments
- gloss
Object of class
gloss_data
- numbering
Whether the gloss should be numbered (in HTML and Word).
Value
Object of class gloss
.
Functions
gloss_pdf()
: Render in PDFgloss_html()
: Render in HTMLgloss_tooltip()
: Tooltip rendering for HTMLgloss_leipzig()
: Leipzig.js enginegloss_word()
: Render in Word
Examples
ex_sp <- "Un ejemplo en español"
ex_gloss <- "DET.M.SG example in Spanish"
ex_trans <- "An example in Spanish"
my_gloss <- new_gloss_data(list(ex_sp, ex_gloss), translation = ex_trans, label="ex1")
gloss_pdf(my_gloss)
#> [1] "\\ex\\label{ex1} \\begingl \\gla Un ejemplo en español// \\glb DET.M.SG example in Spanish// \\glft 'An example in Spanish'// \n \\endgl \\xe \n"
#> attr(,"class")
#> [1] "gloss" "character"
#> attr(,"data")
#> [1] "Un ejemplo en español" "DET.M.SG example in Spanish"
#> attr(,"has_source")
#> [1] FALSE
#> attr(,"source")
#> [1] ""
#> attr(,"has_translation")
#> [1] TRUE
#> attr(,"translation")
#> [1] "\\glft 'An example in Spanish'// \n"
#> attr(,"label")
#> [1] "\\label{ex1}"
#> attr(,"lengths")
#> [1] 4 4
#> attr(,"class")
#> [1] "gloss_data" "character"
gloss_html(my_gloss)
#> [1] "(@ex1) "
#> [2] "<style>.gloss__line--original {font-weight: bold;} .gloss__word .gloss__line:first-child {font-style:italic;} .gloss__word .gloss__line--2 {font-style:normal;font-weight:normal} .gloss__word .gloss__line--3 {font-style:normal;font-weight:normal} .gloss__line--free {font-style:normal;font-weight:normal}</style><div data-gloss=\"\">\n <p class=\"gloss__line--original\"> </p>\n <p>Un ejemplo en español</p>\n <p>DET.M.SG example in Spanish</p>\n <p class=\"gloss__line--free\">'An example in Spanish'</p>\n</div><script>document.addEventListener('DOMContentLoaded', function() {Leipzig({lastLineFree: false}).gloss();});</script>"
#> [3] "\n"
#> attr(,"class")
#> [1] "gloss" "character"
#> attr(,"data")
#> [1] "Un ejemplo en español" "DET.M.SG example in Spanish"
#> attr(,"has_source")
#> [1] FALSE
#> attr(,"source")
#> [1] ""
#> attr(,"has_translation")
#> [1] TRUE
#> attr(,"translation")
#> [1] "'An example in Spanish'"
#> attr(,"label")
#> [1] "ex1"
#> attr(,"lengths")
#> [1] 4 4
#> attr(,"class")
#> [1] "gloss_data" "character"