kwb-r / kwb.pubs Goto Github PK
View Code? Open in Web Editor NEWHelper Functions For Generating Publications Website Based on Hugo Academic Theme
Home Page: https://kwb-r.github.io/kwb.pubs
License: MIT License
Helper Functions For Generating Publications Website Based on Hugo Academic Theme
Home Page: https://kwb-r.github.io/kwb.pubs
License: MIT License
E.g. generate: https://raw.githubusercontent.com/KWB-R/pubs/master/content/de/publication/10/index.md?token=AC3JAI2IL45YHKXEJO6ZRAS7KICV4
I.e. get rid dependencies:
Using d5bf505 the following fails on my computer at KWB:
authors_config <- kwb.pubs::get_authors_config()
authors_metadata <- kwb.pubs::add_authors_metadata(authors_config)
Fehler in stri_trim_both(string) :
invalid UTF-8 byte sequence detected; try calling stri_enc_toutf8()
### does not work as expected
kwb.pubs:::replace_umlauts(string = authors_config$lastname)
[1] "caradot" "conzelmann" "evel" "gnirß" "günsch" "habibi" "jährig" "kleyböcker"
[9] "knoche" "kraus" "matzinger" "miehe" "remy" "riechel" "rouault" "roßbach"
[17] "rose" "rustler" "schubert" "schütz" "schwarzmüller" "seis" "sprenger" "sonnenberg"
[25] "stapf" "tatis muvdi" "toutian" "weigert" "wicke" "zamzow" "zhou"
sessioninfo::session_info()
- Session info -------------------------------------------------------------------------------------------------------------------------------
setting value
version R version 4.0.1 (2020-06-06)
os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate German_Germany.1252
ctype German_Germany.1252
tz Europe/Berlin
date 2020-07-08
- Packages -----------------------------------------------------------------------------------------------------------------------------------
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
bib2df 1.1.1 2019-05-22 [1] CRAN (R 4.0.0)
bit 1.1-15.2 2020-02-10 [1] CRAN (R 4.0.0)
bit64 0.9-7 2017-05-08 [1] CRAN (R 4.0.0)
blob 1.2.1 2020-01-20 [1] CRAN (R 4.0.2)
blogdown 0.19.2 2020-06-23 [1] Github (rstudio/blogdown@f1e08d0)
cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.2)
digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.0)
dplyr * 1.0.0 2020-05-29 [1] CRAN (R 4.0.0)
ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
forcats 0.5.0 2020-03-01 [1] CRAN (R 4.0.0)
fs 1.4.1 2020-04-04 [1] CRAN (R 4.0.0)
generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0)
ggplot2 3.3.2 2020-06-19 [1] CRAN (R 4.0.2)
glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.0)
gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.0)
hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.0)
htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.0)
htmlwidgets 1.5.1 2019-10-08 [1] CRAN (R 4.0.0)
httr 1.4.1 2019-08-05 [1] CRAN (R 4.0.0)
humaniformat 0.6.0 2016-04-24 [1] CRAN (R 4.0.0)
jsonlite 1.6.1 2020-02-02 [1] CRAN (R 4.0.0)
kwb.endnote 0.1.0 2020-06-23 [1] Github (kwb-r/kwb.endnote@76ee94d)
kwb.fakin 0.4.1 2020-06-23 [1] Github (kwb-r/kwb.fakin@7cc1dc0)
kwb.file 0.3.1 2020-06-23 [1] Github (kwb-r/kwb.file@de2ba90)
kwb.pubs * 0.1.0 2020-06-23 [1] Github (kwb-r/kwb.pubs@d5bf505)
kwb.read 0.0.0.9000 2020-06-23 [1] Github (kwb-r/kwb.read@5ae74e3)
kwb.utils 0.6.0 2020-06-17 [1] Github (kwb-r/kwb.utils@fe0a495)
lattice 0.20-41 2020-04-02 [2] CRAN (R 4.0.1)
lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0)
lubridate 1.7.9 2020-06-08 [1] CRAN (R 4.0.0)
magick 2.3 2020-01-24 [1] CRAN (R 4.0.0)
magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0)
Matrix 1.2-18 2019-11-27 [2] CRAN (R 4.0.1)
memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.0)
munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.0)
openxlsx 4.1.5 2020-05-06 [1] CRAN (R 4.0.0)
pillar 1.4.4 2020-05-05 [1] CRAN (R 4.0.0)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.0)
R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
readr 1.3.1 2018-12-21 [1] CRAN (R 4.0.0)
remotes 2.1.1 2020-02-15 [1] CRAN (R 4.0.0)
reticulate 1.16 2020-05-27 [1] CRAN (R 4.0.0)
rlang 0.4.6 2020-05-02 [1] CRAN (R 4.0.0)
RSQLite 2.2.0 2020-01-07 [1] CRAN (R 4.0.2)
rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.0)
scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.0)
stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.0)
tibble 3.0.1 2020-04-20 [1] CRAN (R 4.0.0)
tidyr 1.1.0 2020-05-20 [1] CRAN (R 4.0.0)
tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.0)
tinytex 0.24 2020-06-20 [1] CRAN (R 4.0.2)
vctrs 0.3.1 2020-06-05 [1] CRAN (R 4.0.0)
withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0)
wordcloud2 0.2.1 2018-01-03 [1] CRAN (R 4.0.0)
xfun 0.15 2020-06-21 [1] CRAN (R 4.0.2)
xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.0)
zip 2.0.4 2019-09-01 [1] CRAN (R 4.0.0)
[1] C:/Users/mrustl/Documents/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.1/library
while the same works on my personal notebook:
authors_config <- kwb.pubs::get_authors_config()
authors_metadata <- kwb.pubs::add_authors_metadata(authors_config)
kwb.pubs:::replace_umlauts(string = authors_config$lastname)
[1] "caradot" "conzelmann" "evel" "gnirss"
[5] "guensch" "habibi" "jaehrig" "kleyboecker"
[9] "knoche" "kraus" "matzinger" "miehe"
[13] "remy" "riechel" "rouault" "rossbach"
[17] "rose" "rustler" "schubert" "schuetz"
[21] "schwarzmueller" "seis" "sprenger" "sonnenberg"
[25] "stapf" "tatis muvdi" "toutian" "weigert"
[29] "wicke" "zamzow" "zhou"
sessioninfo::session_info()
- Session info ---------------------------------------------------------------------
setting value
version R version 4.0.0 (2020-04-24)
os Windows 10 x64
system x86_64, mingw32
ui RStudio
language (EN)
collate German_Germany.1252
ctype German_Germany.1252
tz Europe/Berlin
date 2020-07-08
- Packages -------------------------------------------------------------------------
package * version date lib source
assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.0)
blogdown 0.19.2 2020-06-18 [1] Github (rstudio/blogdown@f1e08d0)
cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.0)
crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.0)
dplyr 1.0.0 2020-05-29 [1] CRAN (R 4.0.0)
ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.0)
fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.0)
fs 1.4.2 2020-06-30 [1] CRAN (R 4.0.0)
generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.0)
glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.0)
kwb.pubs 0.1.0 2020-06-18 [1] Github (kwb-r/kwb.pubs@d5bf505)
lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.0)
magick 2.3 2020-01-24 [1] CRAN (R 4.0.0)
magrittr 1.5 2014-11-22 [1] CRAN (R 4.0.0)
packrat 0.5.0 2018-11-14 [1] CRAN (R 4.0.0)
pillar 1.4.4 2020-05-05 [1] CRAN (R 4.0.0)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.0)
purrr 0.3.4 2020-04-17 [1] CRAN (R 4.0.0)
R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.0)
Rcpp 1.0.4.6 2020-04-09 [1] CRAN (R 4.0.0)
rlang 0.4.6 2020-05-02 [1] CRAN (R 4.0.0)
rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.0)
sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.0)
stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.0)
stringr 1.4.0 2019-02-10 [1] CRAN (R 4.0.0)
tibble 3.0.1 2020-04-20 [1] CRAN (R 4.0.0)
tidyr 1.1.0 2020-05-20 [1] CRAN (R 4.0.0)
tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.0)
vctrs 0.3.1 2020-06-05 [1] CRAN (R 4.0.0)
withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.0)
xfun 0.15 2020-06-21 [1] CRAN (R 4.0.2)
[1] C:/Users/micha/Documents/R/win-library/4.0
[2] C:/Program Files/R/R-4.0.0/library
Similar to the data processing function used for cleaning editors (#5) (secondary_author) we need one function for preparing the author column in sdb.ini. Problem is that the names are mostly in lastname, firstname
format (short or complete firstname
) but sometimes may be also in firstname lastname
format.
This function is crucial in order to reduce the dependency hell (#7) and also simplify the .md creation for publications (i.e. all values are filled by one function call!!)
Cleaning (#6) unfortunately introduced a bug. The function replace_publications_in_pub_index_md()
now produces wrong results (content is linked to wrong rec_id and formatting is also not correct, see screenshot for rec_id=1045):
remotes::install_github("kwb-r/kwb.pubs@4ce47443f1812a96e033d5a927a4b307d2d5617b", upgrade = "always")
kwb.pubs::replace_publications_in_pub_index_md(md_paths = pub_md_paths,
endnote_db_refs = en_refs)
Data for bug-fixing:
Please fix and verify that publication stays the same for all records!
Add function to shorten editor names in format lastname, firstname
(Rustler, Michael) to lastname firstname
(Rustler M.)
To be added here:
kwb.pubs/R/add_kwb-style_to_endnote-db.R
Line 85 in 04bc129
Maybe @hsonne has a nice code chunk for it?
Example dataset attached
editors.zip
string <- readRDS(file = "editors.Rds")
kwb.pubs:::clean_editors(string)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.