Skip to content

Commit f32d6fe

Browse files
committed
minor changes
1 parent b6b8849 commit f32d6fe

File tree

5 files changed

+20
-23
lines changed

5 files changed

+20
-23
lines changed

R/tocr.gen.R

+1-2
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,7 @@ process_md <- function(md_lines,
557557
#' fallback the backlinks point to the next header line above `position` (if any found). This will also be the case if `md_flavor = "gitlab"` and
558558
#' `title_tier` is set to a non-header value (`"regular"`, `"bold"` or `"italic"`) because GitLab currently ignores manually set HTML `<id>` attributes.
559559
#' @param backlink_strings String(s) to use as link text back to the TOC. A character vector of length 1 or 2. If two strings are provided, the first one will
560-
#' be used for backlinks below `position`, the second one for backlinks above `position`. Note that at least Unicode 7.0 support is required for the default
561-
#' symbols `\U1F805` and `\U1F807` to be correctly displayed.
560+
#' be used for backlinks below `position`, the second one for backlinks above `position`.
562561
#' @param backlink_position Position of the backlinks. Possible values include:
563562
#' - `"before"`: Before the actual header text.
564563
#' - `"after"`: After the actual header text.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ This package borrows a lot of the [Tidyverse](https://www.tidyverse.org/) design
7373

7474
- Usage of [Rs right-hand assignment operator `->`](https://rdrr.io/r/base/assignOps.html) is not allowed[^3].
7575

76-
- R source code is *not* split over several files as [suggested by the TSG](https://style.tidyverse.org/package-files.html) but instead is (as far as possible) kept in the single file [`Rmd/tocr.Rmd`](Rmd/tocr.Rmd) which is well-structured thanks to its [Markdown support](#r-markdown-format).
76+
- R source code is *not* split over several files as [suggested by the TSG](https://style.tidyverse.org/package-files.html) but instead is (as far as possible) kept in the single file [`Rmd/tocr.Rmd`](https://gitlab.com/rpkg.dev/tocr/-/tree/master/Rmd/tocr.Rmd) which is well-structured thanks to its [Markdown support](#r-markdown-format).
7777

7878
As far as possible, these deviations from the TSG plus some additional restrictions are formally specified in the [lintr configuration file](https://github.com/jimhester/lintr#project-configuration) [`.lintr`](.lintr), so lintr can be used right away to check for formatting issues:
7979

Rmd/tocr.Rmd

+16-17
Original file line numberDiff line numberDiff line change
@@ -557,23 +557,23 @@ process_md <- function(md_lines,
557557

558558
## DEBUGGING
559559

560-
### Initialize all parameters of function `add_toc()` with default/dummy params
560+
### Dummy run
561561

562562
```{r, purl = FALSE}
563-
md <- "https://raw.githubusercontent.com/rstudio/rmarkdown/master/README.md"
564-
min_tier <- 2L
565-
max_tier <- 6L
566-
position <- "above"
567-
md_flavor <- "github"
568-
add_title <- TRUE
569-
title <- "Table of contents"
570-
title_tier <- min_tier
571-
add_backlinks <- add_title
572-
backlink_strings <- c("\U1F805", "\U1F807")
573-
backlink_position <- "before"
574-
listing_style <- "-"
575-
toc_id <- "toc"
576-
old_toc_id <- toc_id
563+
tocr::add_toc(md = "https://raw.githubusercontent.com/rstudio/rmarkdown/master/README.md",
564+
min_tier = 2L,
565+
max_tier = 6L,
566+
position = "above",
567+
md_flavor = "github",
568+
add_title = TRUE,
569+
title = "Table of contents",
570+
title_tier = min_tier,
571+
add_backlinks = add_title,
572+
backlink_strings = c("\u2191", "\u2193"),
573+
backlink_position = "before",
574+
listing_style = "-",
575+
toc_id = "toc",
576+
old_toc_id = toc_id)
577577
```
578578

579579
# EXPORTED
@@ -622,8 +622,7 @@ old_toc_id <- toc_id
622622
#' fallback the backlinks point to the next header line above `position` (if any found). This will also be the case if `md_flavor = "gitlab"` and
623623
#' `title_tier` is set to a non-header value (`"regular"`, `"bold"` or `"italic"`) because GitLab currently ignores manually set HTML `<id>` attributes.
624624
#' @param backlink_strings String(s) to use as link text back to the TOC. A character vector of length 1 or 2. If two strings are provided, the first one will
625-
#' be used for backlinks below `position`, the second one for backlinks above `position`. Note that at least Unicode 7.0 support is required for the default
626-
#' symbols `\U1F805` and `\U1F807` to be correctly displayed.
625+
#' be used for backlinks below `position`, the second one for backlinks above `position`.
627626
#' @param backlink_position Position of the backlinks. Possible values include:
628627
#' - `"before"`: Before the actual header text.
629628
#' - `"after"`: After the actual header text.

man/add_toc.Rd

+1-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkgdown/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ This package borrows a lot of the [Tidyverse](https://www.tidyverse.org/) design
7171
7272
- Usage of [R's right-hand assignment operator `->`](https://rdrr.io/r/base/assignOps.html) is not allowed[^3].
7373

74-
- R source code is *not* split over several files as [suggested by the TSG](https://style.tidyverse.org/package-files.html) but instead is (as far as possible) kept in the single file [`Rmd/tocr.Rmd`](Rmd/tocr.Rmd) which is well-structured thanks to its [Markdown support](#r-markdown-format).
74+
- R source code is *not* split over several files as [suggested by the TSG](https://style.tidyverse.org/package-files.html) but instead is (as far as possible) kept in the single file [`Rmd/tocr.Rmd`](https://gitlab.com/rpkg.dev/tocr/-/tree/master/Rmd/tocr.Rmd) which is well-structured thanks to its [Markdown support](#r-markdown-format).
7575

7676
As far as possible, these deviations from the TSG plus some additional restrictions are formally specified in the [lintr configuration file](https://github.com/jimhester/lintr#project-configuration) [`.lintr`](.lintr), so lintr can be used right away to check for formatting issues:
7777

0 commit comments

Comments
 (0)