Skip to content

Commit

Permalink
Add '3.1.8' argument; version/news bump
Browse files Browse the repository at this point in the history
  • Loading branch information
seananderson committed Mar 21, 2024
1 parent a7b19aa commit 10739cc
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 7 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: csasdown
Title: Reproducible CSAS Reports with Bookdown
Version: 0.1.4
Version: 0.1.5
Authors@R:
c(person(given = c("Sean", "C."),
family = "Anderson",
Expand Down Expand Up @@ -82,7 +82,7 @@ ByteCompile: true
Encoding: UTF-8
LazyData: true
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
SystemRequirements: pandoc (>= 1.18) - http://pandoc.org
Config/testthat/parallel: true
Config/testthat/edition: 2
8 changes: 7 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# csasdown

# csasdown 0.1.5

* Updates for compatibility with pandoc >= 3.1.8. #255 #253

* Fix bug with extra . in French sections. #254

# csasdown 0.1.4

* Add *optional* `show_continued_text` logical YAML argument to enable or
Expand Down Expand Up @@ -27,7 +33,7 @@

* `verbose` was added to many functions. If you run `render(verbose = TRUE)` you will see a detailed listing of the steps taken during rendering, including line numbers of important items.

* A new function `csasdown::render()` will auto-detect your document type (*resdoc*, *resdoc-b*, *sr*, *techreport*) and render accordingly. We recommend using this over `bookdown::render_book()`. The 'Knit' button in RStudio should properly choose `csasdown::render()`.
* A new function `csasdown::render()` will auto-detect your document type (*4resdoc*, *resdoc-b*, *sr*, *techreport*) and render accordingly. We recommend using this over `bookdown::render_book()`. The 'Knit' button in RStudio should properly choose `csasdown::render()`.

* New YAML options are required for this render method; an error will be produced when you run `render()` explaining which ones you are missing. These new YAML options are new French options and are required to render the document. Even if you don't plan on using French, you must enter them with some (any) default text. They are:
- `french_month`
Expand Down
8 changes: 4 additions & 4 deletions R/add-appendix-subsection-refs.R
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@ add_appendix_subsection_refs <- function(x){
if(length(star_chap_inds)){
counters <- paste0("app_counter_", seq_along(star_chap_inds))

if(pandoc_curr_ver_is_before()){
if(pandoc_curr_ver_is_before("3.1.8")){
pre_starred_x <- x[1:(star_chap_inds[1] - 3)]
}else{
pre_starred_x <- x[1:(star_chap_inds[1] - 2)]
}
appendix_chunks <- list()
for(i in seq_along(star_chap_inds)){
if(pandoc_curr_ver_is_before()){
if(pandoc_curr_ver_is_before("3.1.8")){
if(i == length(star_chap_inds)){
appendix_chunks[[i]] <- x[(star_chap_inds[i] - 2):length(x)]
}else{
Expand Down Expand Up @@ -58,7 +58,7 @@ add_appendix_subsection_refs <- function(x){
sec_chunks <- list()
sec_header <- list()
for(i in seq_along(app_chunk_inds)){
if(pandoc_curr_ver_is_before()){
if(pandoc_curr_ver_is_before("3.1.8")){
if(i == length(app_chunk_inds)){
sec_chunks[[i]] <- app_chunk[(app_chunk_inds[i] - 1):length(app_chunk)]
}else{
Expand All @@ -72,7 +72,7 @@ add_appendix_subsection_refs <- function(x){
}
}
# Check for a label and allow missing label
if(pandoc_curr_ver_is_before() &&
if(pandoc_curr_ver_is_before("3.1.8") &&
!length(grep("^\\\\hypertarget\\{", sec_chunks[[i]][1]))){
# An auto-generated label was not added (using manually-added label) so switching the
# label and appsection is necessary
Expand Down
24 changes: 24 additions & 0 deletions man/csasdown.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 10739cc

Please sign in to comment.