Skip to content

Commit 9193adc

Browse files
authored
Merge pull request #98 from inbo/update
Version 0.6.3
2 parents 47b9e30 + c52b560 commit 9193adc

10 files changed

+31
-29
lines changed

.github/workflows/examples.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ jobs:
1414
name: "test Rmd"
1515
steps:
1616
- name: checkout
17-
uses: actions/checkout@v2
17+
uses: actions/checkout@v4
1818
- name: build examples
19-
uses: inbo/actions/[email protected].2
19+
uses: inbo/actions/[email protected].3
2020
env:
2121
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2222
EXAMPLE_BRANCH: main

.zenodo.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"title": "INBOmd: Markdown Templates for INBO",
3-
"version": "0.6.2",
3+
"version": "0.6.3",
44
"license": "GPL-3.0",
55
"upload_type": "software",
66
"description": "<p>Several templates to generate reports, presentations and posters.<\/p>",

CITATION.cff

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ identifiers:
2626
value: 10.5281/zenodo.842223
2727
- type: url
2828
value: https://inbo.github.io/INBOmd/
29-
version: 0.6.2
29+
version: 0.6.3

DESCRIPTION

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: INBOmd
33
Title: Markdown Templates for INBO
4-
Version: 0.6.2
4+
Version: 0.6.3
55
Authors@R: c(
66
person("Thierry", "Onkelinx", , "[email protected]", role = c("aut", "cre"),
77
comment = c(ORCID = "0000-0001-8804-4216", affiliation = "Research Institute for Nature and Forest (INBO)")),
@@ -49,4 +49,4 @@ Config/checklist/keywords: markdown; bookdown; corporate identity;
4949
Encoding: UTF-8
5050
Language: en-GB
5151
Roxygen: list(markdown = TRUE)
52-
RoxygenNote: 7.2.3
52+
RoxygenNote: 7.3.0

Dockerfile

+5-6
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,6 @@ RUN apt-get update \
5757
&& apt-get install -y --no-install-recommends \
5858
git
5959

60-
## Install pandoc
61-
RUN apt-get update \
62-
&& apt-get install -y --no-install-recommends \
63-
pandoc \
64-
pandoc-citeproc
65-
6660
## Install gpg
6761
RUN apt-get update \
6862
&& apt-get install -y --no-install-recommends \
@@ -82,6 +76,11 @@ RUN apt-get update \
8276
&& apt-get install -y --no-install-recommends \
8377
r-base-dev
8478

79+
## Install pandoc
80+
RUN wget https://github.com/jgm/pandoc/releases/download/3.1.8/pandoc-3.1.8-1-amd64.deb \
81+
&& dpkg -i pandoc-3.1.8-1-amd64.deb \
82+
&& rm pandoc-3.1.8-1-amd64.deb
83+
8584
COPY docker/.Rprofile /usr/lib/R/etc/Rprofile.site
8685

8786
## R packages

NAMESPACE

+1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ importFrom(qrcode,qr_code)
7777
importFrom(rmarkdown,includes_to_pandoc_args)
7878
importFrom(rmarkdown,knitr_options)
7979
importFrom(rmarkdown,output_format)
80+
importFrom(rmarkdown,pandoc_available)
8081
importFrom(rmarkdown,pandoc_options)
8182
importFrom(rmarkdown,pandoc_path_arg)
8283
importFrom(rmarkdown,pandoc_variable_arg)

NEWS.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# INBOmd 0.6.3
2+
3+
* `pdf_report()` enforces pandoc >= 3.1.8
4+
* `create_report()` fixed (#97)
5+
16
# INBOmd 0.6.2
27

38
* `pdf_report()`, `gitbook()` and `epub_book()` gain an option to create

R/create_report.R

+1
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,5 @@ check_author <- function(lang = "nl") {
310310
)
311311
person <- check_author(lang = "nl")
312312
}
313+
return(person)
313314
}

R/pdf_report.R

+10-14
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#' @export
88
#' @importFrom assertthat assert_that has_name is.string
99
#' @importFrom fs path
10-
#' @importFrom rmarkdown output_format knitr_options pandoc_options
11-
#' pandoc_variable_arg includes_to_pandoc_args pandoc_version
12-
#' @importFrom utils compareVersion
10+
#' @importFrom rmarkdown output_format knitr_options pandoc_available
11+
#' pandoc_options pandoc_variable_arg includes_to_pandoc_args
1312
#' @family output
1413
pdf_report <- function(
1514
fig_crop = "auto", includes = NULL, pandoc_args = NULL, ...
1615
) {
16+
pandoc_available(version = "3.1.8", error = TRUE)
1717
dots <- list(...)
1818
assert_that(
1919
!has_name(dots, "number_sections"), msg =
@@ -97,12 +97,8 @@ pdf_report <- function(
9797
)
9898

9999
args <- c(
100-
"--template", template,
101-
ifelse(
102-
compareVersion(as.character(pandoc_version()), "2") < 0,
103-
"--latex-engine", "--pdf-engine"
104-
),
105-
"xelatex", pandoc_args, c("--csl", pandoc_path_arg(csl)),
100+
"--template", template, "--pdf-engine",
101+
"xelatex", pandoc_args, "--csl", pandoc_path_arg(csl),
106102
includes_to_pandoc_args(includes)
107103
)
108104
args <- args[args != ""]
@@ -195,11 +191,11 @@ pdf_report <- function(
195191

196192
# move appendix after bibliography
197193
appendix <- grep("\\\\appendix", text)
198-
startbib <- grep("\\\\hypertarget\\{refs\\}\\{\\}", text) # nolint: absolute_path_linter, line_length_linter.
194+
startbib <- grep("\\\\phantomsection\\\\label\\{refs\\}", text) # nolint: absolute_path_linter, line_length_linter.
199195
if (length(startbib)) {
200196
if (length(appendix)) {
201197
text <- c(
202-
text[1:(appendix - 1)], # mainmatter
198+
head(text, appendix - 1), # mainmatter
203199
"\\chapter*{\\bibname}",
204200
"\\addcontentsline{toc}{chapter}{\\bibname}",
205201
text[startbib], # bibliography
@@ -208,18 +204,18 @@ pdf_report <- function(
208204
"",
209205
text[(startbib + 2):(length(text) - 1)],
210206
text[(appendix):(startbib - 1)], # appendix
211-
text[length(text)] # backmatter
207+
tail(text, 1) # backmatter
212208
)
213209
} else {
214210
text <- c(
215-
text[1:(startbib - 1)], # mainmatter
211+
head(text, startbib - 1), # mainmatter
216212
"\\chapter*{\\bibname}",
217213
"\\addcontentsline{toc}{chapter}{\\bibname}",
218214
text[startbib], # bibliography
219215
"",
220216
text[startbib + 1],
221217
"",
222-
text[(startbib + 2):length(text)]
218+
tail(text, -startbib - 1)
223219
)
224220
}
225221
}

inst/CITATION

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ citHeader("To cite `INBOmd` in publications please use:")
22
# begin checklist entry
33
bibentry(
44
bibtype = "Manual",
5-
title = "INBOmd: Markdown Templates for INBO. Version 0.6.2",
5+
title = "INBOmd: Markdown Templates for INBO. Version 0.6.3",
66
author = c( author = c(person(given = "Thierry", family = "Onkelinx"))),
7-
year = 2023,
7+
year = 2024,
88
url = "https://inbo.github.io/INBOmd/",
99
abstract = "Several templates to generate reports, presentations and posters.",
10-
textVersion = "Onkelinx, Thierry (2023) INBOmd: Markdown Templates for INBO. Version 0.6.2. https://inbo.github.io/INBOmd/",
10+
textVersion = "Onkelinx, Thierry (2024) INBOmd: Markdown Templates for INBO. Version 0.6.3. https://inbo.github.io/INBOmd/",
1111
keywords = "markdown; bookdown; corporate identity; template",
1212
doi = "10.5281/zenodo.842223",
1313
)

0 commit comments

Comments
 (0)