knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
library(gitdown) library(git2r) library(dplyr)
Create a versioned directory with some commits and a NEWS.md in a temporary directory
#
ticket
repo <- fake_repo()
The main function of {gitdown} is to build this gitbook with all commit messages ordered according to a pattern. Each commit message associated with an issue will be recorded in the section of this issue. A commit message can thus appears multiple times if it is associated with multiple issues.
If you have your own referencing system for tickets in an external software, you can also create the gitbook associated like using ticket
as in the example below.
git_down(repo, pattern = c("Tickets" = "ticket[[:digit:]]+", "Issues" = "#[[:digit:]]+"))
As a side effect of {gitdown}, you can get some intermediate information used to build the book with some exported functions.
get_commits_tags(repo, ref = "main")
#123
get_commits_pattern(repo, pattern = "#[[:digit:]]+", ref = "main")
repo_pkg <- fake_repo(as.package = TRUE) # List only files in R/ directory create_vignette_last_modif(repo_pkg) # List all files of the git repository create_vignette_last_modif(repo_pkg, path = "")
With this example, the vignette will show this content:
repo_pkg <- fake_repo(as.package = TRUE) cat(present_files(repo_pkg, path = ""))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.