Skip to content

Commit

Permalink
feat: now writing inline citation for each model document
Browse files Browse the repository at this point in the history
  • Loading branch information
brycefrank committed Oct 7, 2024
1 parent b52ad03 commit fea33ca
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/json.R
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,8 @@ model_to_json <- function(model) {
#' representations of models in the publication.
publication_to_json <- function(publication) {
citation_json <- citation_to_json(publication@citation)
inline_citation <- prepare_inline_citation(publication@citation)

models_json <- list()
model_ids <- c()

Expand All @@ -289,8 +291,12 @@ publication_to_json <- function(publication) {

for (k in 1:length(model_set_ij@models)) {
model_ijk <- model_set_ij@models[[k]]
models_json[[l]] <- model_to_json(model_ijk)
model_ids <- c(model_ids, models_json[[l]][["_id"]])

model_json <- model_to_json(model_ijk)
model_json$inline_citation <- jsonlite::unbox(inline_citation)

models_json[[l]] <- model_json
model_ids <- c(model_ids, models_json[["_id"]])

l <- l + 1
}
Expand Down

0 comments on commit fea33ca

Please sign in to comment.