gitdown

Document each modification of your software by turning your git commits into a gitbook

https://github.com/thinkr-open/gitdown

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (18.6%) to scientific vocabulary

Keywords

bookdown git gitbook
Last synced: 6 months ago · JSON representation

Repository

Document each modification of your software by turning your git commits into a gitbook

Basic Info
Statistics
  • Stars: 35
  • Watchers: 4
  • Forks: 5
  • Open Issues: 1
  • Releases: 6
Topics
bookdown git gitbook
Created over 6 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License Code of conduct

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
# Copy reference/images to man/images
# reference folder is required to work with pkgdown
if (!dir.exists("man/figures")) {dir.create("man/figures")}
file.copy(list.files("reference/figures", full.names = TRUE),
          "man/figures", overwrite = TRUE)
# if (dir.exists("docs")) {
#   file.copy("reference/figures/thinkr-hex-remedy-favicon.ico",
#             "docs/favicon.ico", overwrite = TRUE)
# }
```
# gitdown 


[![R-CMD-check](https://github.com/ThinkR-open/gitdown/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/ThinkR-open/gitdown/actions/workflows/R-CMD-check.yaml)
[![Coverage status](https://codecov.io/gh/ThinkR-open/gitdown/branch/main/graph/badge.svg)](https://codecov.io/github/ThinkR-open/gitdown?branch=main)
[![CRAN status](https://www.r-pkg.org/badges/version/gitdown)](https://CRAN.R-project.org/package=gitdown)


The goal of {gitdown} is to build a bookdown report of commit messages arranged according to a pattern. Book can be organized according to git tags, issues mentioned (*e.g.* `#123`) or any custom character chain included in your git commit messages (*e.g.* `category_` for use like `category_ui`, `category_doc`, ...).

Full documentation on {pkgdown} site : https://thinkr-open.github.io/gitdown/index.html  

## Installation

You can install the stable version of {gitdown} from CRAN:

```r
install.packages("gitdown")
```


You can install the last version of {gitdown} from GitHub:

``` r
remotes::install_github("ThinkR-open/gitdown")
```

## Create a reproducible example of a versioned directory

Create a versioned directory with some commits and a NEWS.md in a temporary directory

- Some commits mention an issue with `#`
- Some commits mention a ticket with `ticket`
- A commit is associated with a tag

```{r example, message=FALSE}
library(dplyr)
library(gitdown)
## Create fake repository for the example
repo <- fake_repo()
```

## Create a gitbook of commits sorted by a pattern

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.

```{r, eval=FALSE}
git_down(repo, pattern = c("Tickets" = "ticket[[:digit:]]+",
                           "Issues" = "#[[:digit:]]+"))
```

```{r, echo=FALSE, out.width="90%", fig.align="center"}
knitr::include_graphics("reference/figures/gitdown_links.png")
```

If you add a table of correspondence, you can change titles of the patterns.  
_Note that you can use [{gitlabr}](https://statnmap.github.io/gitlabr/) or [{gh}](https://gh.r-lib.org) to retrieve list of issues from GitLab or GitHub respectively, as presented in ["Download GitLab or GitHub issues and make a summary report of your commits"](https://rtask.thinkr.fr/download-gitlab-or-github-issues-and-make-a-summary-report-of-your-commits/)._  

```{r, eval=FALSE}
# With table of correspondence
pattern.table <- data.frame(
  number = c("#2", "#1", "#1000"),
  title = c("#2 A second issue to illustrate a blog post",
            "#1 An example of issue",
            "#1000 issue with no commit"))
git_down(
  pattern = c("Issue" = "#[[:digit:]]+"),
  pattern.table = pattern.table
)
```
_Note that characters like `[`, `]`, `_` or `*` will be replaced by `-` in the titles to avoid conflicts with markdown syntax._


```{r, echo=FALSE, out.width="90%", fig.align="center"}
knitr::include_graphics("reference/figures/issues-with-title.png")
```

## Read list of commits and extract information

As a side effect of {gitdown}, you can get some intermediate information used to build the book with some exported functions.

Get commits with issues mentioned. The searched pattern is a `#` followed by at least one number: `"#[[:digit:]]+"`. Variable `pattern.content` lists patterns found in the commit messages. 

```{r}
get_commits_pattern(repo, pattern = "#[[:digit:]]+", ref = "main") %>% 
  select(pattern.content, everything())
```

Get commits with issues and specific home-made pattern. Use a named vector to properly separate types of patterns.

```{r}
get_commits_pattern(
  repo, 
  pattern =  c("Tickets" = "ticket[[:digit:]]+", "Issues" = "#[[:digit:]]+"),
  ref = "main"
) %>% 
  select(pattern.type, pattern.content, everything())
```


## Create a vignette that lists all files with date of modification

```{r, eval=FALSE}
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:  

```{r, echo=FALSE, results='asis'}
repo_pkg <- fake_repo(as.package = TRUE)
cat(present_files(repo_pkg, path = ""))
```

## Sponsor

The development of this package has been sponsored by: 


  
## Code of Conduct
  
Please note that the {gitdown} project is released with a
[Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html).
By contributing to this project, you agree to abide by its terms.

Owner

  • Name: ThinkR
  • Login: ThinkR-open
  • Kind: organization
  • Email: welcome@thinkr.fr
  • Location: France

R Engineering, training, and consulting

GitHub Events

Total
  • Watch event: 1
  • Push event: 37
Last Year
  • Watch event: 1
  • Push event: 37

Committers

Last synced: 11 months ago

All Time
  • Total Commits: 60
  • Total Committers: 5
  • Avg Commits per committer: 12.0
  • Development Distribution Score (DDS): 0.1
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
statnmap s****n@t****r 54
cervan c****n@t****r 3
margot m****t@t****r 1
cervangirard c****d@g****m 1
Stefan Widgren s****n@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 7
  • Total pull requests: 14
  • Average time to close issues: about 2 months
  • Average time to close pull requests: 1 day
  • Total issue authors: 4
  • Total pull request authors: 4
  • Average comments per issue: 1.14
  • Average comments per pull request: 0.71
  • Merged pull requests: 11
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • statnmap (4)
  • JiaxiangBU (1)
  • gagolews (1)
  • cderv (1)
Pull Request Authors
  • statnmap (11)
  • stewid (1)
  • MargotBr (1)
  • Cervangirard (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • cran 330 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 6
  • Total maintainers: 1
cran.r-project.org: gitdown

Turn Your Git Commit Messages into a HTML Book

  • Versions: 6
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 330 Last month
Rankings
Stargazers count: 8.6%
Forks count: 10.8%
Average: 21.9%
Dependent repos count: 24.0%
Dependent packages count: 28.8%
Downloads: 37.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 3.4 depends
  • attempt * imports
  • bookdown * imports
  • dplyr * imports
  • git2r >= 0.26.0 imports
  • knitr * imports
  • magrittr * imports
  • purrr * imports
  • rmarkdown * imports
  • stats * imports
  • stringi * imports
  • tidyr * imports
  • utils * imports
  • testthat >= 3.0.0 suggests
  • withr * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v4 composite
  • r-lib/actions/check-r-package v2 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/pkgdown.yaml actions
  • JamesIves/github-pages-deploy-action v4.5.0 composite
  • actions/checkout v4 composite
  • r-lib/actions/setup-pandoc v2 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite
.github/workflows/test-coverage.yaml actions
  • actions/checkout v4 composite
  • actions/upload-artifact v4 composite
  • r-lib/actions/setup-r v2 composite
  • r-lib/actions/setup-r-dependencies v2 composite