Skip to content

Commit

Permalink
Update docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
maciekbanas committed Sep 25, 2023
1 parent 3d14838 commit 459e7fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
7 changes: 7 additions & 0 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,13 @@ devtools::install_github("r-world-devs/GitStats")

Please remember to have your access tokens stored as environment variables: `GITHUB_PAT` for access to GitHub API and `GITLAB_PAT` for GitLab API.

### Scope of tokens

In the spirit of good practice of setting minimal scope of access to tokens for `GitStats` to work you need:

- [GitHub] `public_repo` and `read:user` scopes,
- [GitLab] `read_api` scope.

## GitStats workflow

On how to use GitStats, refer to the [documentation](placeholder for a link to docs).
Expand Down
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ Please remember to have your access tokens stored as environment
variables: `GITHUB_PAT` for access to GitHub API and `GITLAB_PAT` for
GitLab API.

### Scope of tokens

In the spirit of good practice of setting minimal scope of access to
tokens for `GitStats` to work you need:

- \[GitHub\] `public_repo` and `read:user` scopes,
- \[GitLab\] `read_api` scope.

## GitStats workflow

On how to use GitStats, refer to the
Expand Down
6 changes: 3 additions & 3 deletions vignettes/gitstats_workflow.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ git_stats <- create_gitstats() %>%

If you have your token environment variables stored in `GITHUB_PAT` or `GITHUB_PAT_*` and `GITLAB_PAT` or `GITLAB_PAT_*` you do not need to specify them in `set_host()` function, `GitStats` will automatically find them.

```{r}
```{r, eval = FALSE}
git_stats <- create_gitstats() %>%
set_host(
api_url = "https://api.github.com",
Expand Down Expand Up @@ -96,13 +96,13 @@ gitstats_plot(

If you work with interactive app, you can use a `plotly_mode`.

```r
```{r}
gitstats_plot(repos_stats, plotly_mode = TRUE)
```

## Commits workflow

It is basically very simillar to the repositories one, but you should specify additionally at least `date_from` parameter.
It is basically very similar to the repositories one, but you should specify additionally at least `date_from` parameter.

```{r, message = FALSE}
pull_commits(
Expand Down

0 comments on commit 459e7fa

Please sign in to comment.