Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ThierryO committed Nov 27, 2023
1 parent 60edcb8 commit 22e6eda
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
13 changes: 12 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,13 @@ RUN apt-get update \
r-cran-tinytex \
r-cran-webshot

## Install textshape
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libfribidi-dev \
libharfbuzz-dev \
&& Rscript -e 'remotes::install_cran("textshape")'

## Install ragg
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand Down Expand Up @@ -176,7 +183,11 @@ RUN Rscript -e 'remotes::install_cran("lipsum")'
RUN Rscript -e 'remotes::install_cran("here")'

## Install gert
RUN Rscript -e 'remotes::install_cran("gert")'
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libcurl4-openssl-dev \
libssl-dev \
&& Rscript -e 'remotes::install_cran("gert")'

## Install webshot dependency
RUN Rscript -e 'webshot::install_phantomjs()'
Expand Down
2 changes: 1 addition & 1 deletion R/ebook.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ epub_book <- function() {
validate_rightsholder() -> fm
assert_that(
has_name(fm, "reportnr"), has_name(fm, "year"),
has_name("cover_description")
has_name(fm, "cover_description")

Check warning on line 20 in R/ebook.R

View check run for this annotation

Codecov / codecov/patch

R/ebook.R#L18-L20

Added lines #L18 - L20 were not covered by tests
)
style <- ifelse(has_name(fm, "style"), fm$style, "INBO")
assert_that(length(style) == 1)
Expand Down
15 changes: 12 additions & 3 deletions R/pdf_report.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,12 @@ pdf_report <- function(
} else {
if (has_name(fm, "doi")) {
validate_doi(fm$doi)
draft <- draft && !all(c("depotnr", "doi", "reportnr") %in% names(fm))

Check warning on line 120 in R/pdf_report.R

View check run for this annotation

Codecov / codecov/patch

R/pdf_report.R#L118-L120

Added lines #L118 - L120 were not covered by tests
} else {
draft <- TRUE
fm$doi <- "!!! missing DOI !!!"

Check warning on line 123 in R/pdf_report.R

View check run for this annotation

Codecov / codecov/patch

R/pdf_report.R#L122-L123

Added lines #L122 - L123 were not covered by tests
}
draft <- draft && !all(c("depotnr", "doi", "reportnr") %in% names(fm))
fm$pagefootmessage <- fm$doi

Check warning on line 125 in R/pdf_report.R

View check run for this annotation

Codecov / codecov/patch

R/pdf_report.R#L125

Added line #L125 was not covered by tests
}
if (draft) {
c(en = "DRAFT", fr = "CONCEPTION", nl = "ONTWERP")[fm$lang] |>
Expand All @@ -132,11 +136,16 @@ pdf_report <- function(
var_arg <- c(
documentclass = "report",
style = c(
Flanders_en = "flanders_report", Flandres_fr = "flandre_report",
Flanders_en = "flanders_report", Flanders_fr = "flandre_report",
Vlaanderen_nl = "vlaanderen_report", INBO_nl = "inbo_report"
)[paste(fm$style, fm$lang, sep = "_")] |>
unname(),
fm[c("corresponding", "doi", "internal", "lof", "lot", "watermark")],
fm[
c(
"corresponding", "doi", "internal", "lof", "lot", "watermark",
"pagefootmessage"

Check warning on line 146 in R/pdf_report.R

View check run for this annotation

Codecov / codecov/patch

R/pdf_report.R#L133-L146

Added lines #L133 - L146 were not covered by tests
)
],
shortauthor = gsub("\\&", "\\\\&", fm$shortauthor),
babel = paste(languages[c(fm$other_lang, fm$lang)], collapse = ",")

Check warning on line 150 in R/pdf_report.R

View check run for this annotation

Codecov / codecov/patch

R/pdf_report.R#L149-L150

Added lines #L149 - L150 were not covered by tests
)
Expand Down
12 changes: 2 additions & 10 deletions inst/local_tex/tex/latex/inborapport_2015/inbo_report.sty
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@
\fancyhead{}
\fancyfoot{}
\fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}}
\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}}}}
\ifnum \@public = 0
\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}} }}
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}}
\else
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}}
\fi
\renewcommand{\footrule}{\vbox to 8pt{\hbox
to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont\leaders\hbox{/}\hfill}\vss}}
\renewcommand{\headrulewidth}{0pt}
Expand All @@ -29,12 +25,8 @@ to\headwidth{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}
\fancyhead{}
\fancyfoot{}
\fancyfoot[LO, RE]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \mainColourURL{\href{https://www.vlaanderen.be/inbo}{vlaanderen.be/inbo}}}}
\ifnum \@public = 0
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}}
\else
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@doi}}
\fi
\fancyfoot[LE, RO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont Pagina~\textbf{\thepage}~van~\textbf{\pageref*{LastPage}}}}
\fancyfoot[CE, CO]{{\color{main.colour}\fontsize{\fontsizefooter}{\fontsizefooterinter}\selectfont \@pagefootmessage}}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0pt}
}
Expand Down

0 comments on commit 22e6eda

Please sign in to comment.