Skip to content

export_glossary uses different YAML names than load_entries #2

@truecluster

Description

@truecluster

Thanks for the nice package: I got strange errors when using load_entries on a file that I had written with export_glossary and tracked it down to a confusion of the names used in the YAML file. export_glossary with the following names changes works for me:
`export_glossary <- function(file, ...){
x <- get_entries()
idx <- sapply(x,'[[',1)%in%'definition'
names(x) <- NULL

out <- list(
definitions = lapply(x[idx],function(xx){
xx[c('entry', 'name', 'description')]
}),
acronyms = lapply(x[!idx],function(xx){
ret <- xx[c('label', 'name', 'description')]
names(ret) <- c('entry','label','long')
ret
})
)

yaml::write_yaml(out,file, ...)
}
`
Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions