Git Product home page Git Product logo

Comments (3)

hsonne avatar hsonne commented on June 2, 2024

The problem was not in replace_publications_in_pub_index_md() but in my new function format_given() where I defined the arguments in the wrong order. This affected the content of en_refs when being modified by add_columns_to_endnote_db(). Thus, your uploaded version of en_refs (in en_refs.zip) was already "corrupt". This is fixed now. I used the following script to recreate the md files. However, I get differences due to the fact that I do not have the latest version of the Endnote db (I assume).

remotes::install_github("kwb-r/kwb.pubs@clean", upgrade = "never")

path_en_db <- "<path-to-my-local-endnote-dbs>/KWB-documents_20191205.Data/sdb/sdb.eni"

contents <- kwb.pubs::read_endnote_db(path_en_db)

en_refs <- kwb.pubs::add_columns_to_endnote_db(contents$refs)

en_refs$publication <- stringr::str_replace_all(en_refs$publication, pattern = '"', '\\\\"')
en_refs$publication <- sprintf("\"%s\"", en_refs$publication)

path <- "content/de/publication"
pub_md_paths <- dir(path, "md$", full.names = TRUE, recursive = TRUE)

#kwb.pubs::replace_dates_in_pub_index_md(pub_md_paths, en_refs)
#kwb.pubs::replace_publishdates_in_pub_index_md(pub_md_paths, en_refs)
kwb.pubs::replace_publications_in_pub_index_md(pub_md_paths, en_refs)

Can you do the verification test?

from kwb.pubs.

mrustl avatar mrustl commented on June 2, 2024

I can verify that the issue is fixed now

library(kwb.pubs)
### using en_refs.Rds from zip file (see above)
en_refs <- readRDS("en_refs.Rds") %>% dplyr::select(- publish_datetime, - publication)
en_refs <- kwb.pubs::add_columns_to_endnote_db(en_refs)


en_refs$publication <- stringr::str_replace_all(en_refs$publication, pattern = '"', '\\\\"')
en_refs$publication <- sprintf("\"%s\"", en_refs$publication)

path <- "content/de/publication"
pub_md_paths <- dir(path, "md$", full.names = TRUE, recursive = TRUE)

#kwb.pubs::replace_dates_in_pub_index_md(pub_md_paths, en_refs)
#kwb.pubs::replace_publishdates_in_pub_index_md(pub_md_paths, en_refs)
kwb.pubs::replace_publications_in_pub_index_md(pub_md_paths, en_refs)

Could you add this step to the function kwb.pubs::add_kwb_style() ?

en_refs$publication <- stringr::str_replace_all(en_refs$publication, pattern = '"', '\\\\"')
en_refs$publication <- sprintf("\"%s\"", en_refs$publication)

from kwb.pubs.

mrustl avatar mrustl commented on June 2, 2024

Hi @hsonne ,

seems we have one more issue to solve (EN ID: 675, 855,1163, 1164) -> https://github.com/KWB-R/kwb.pubs/files/5145961/en_refs.zip):

grafik

grafik

grafik

Maybe just a different behavior in case of missing data? I think your approach is there better than my simple one before!

from kwb.pubs.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.