Comments (3)
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.
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.
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):
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)
- Import scripts from repo "pubs" (where relevant)
- feat: import "authors" from Endnote DB (sdb.ini)
- Add functions for generating "index.md" files based on "kwb.endnote"
- Autogenerate CVs with rorcid
- encoding issue on KWB pc
- feat: shorten "editors" names HOT 2
- feat: generate "publication.md" completely with R using Endnote DB (sdb.ini)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kwb.pubs.