|
1 | 1 | #' R client for GitHub gists.
|
2 |
| -#' |
3 |
| -#' gistr allows you to peform actions on gists, including listing, forking, starring, creating, |
| 2 | +#' |
| 3 | +#' gistr allows you to peform actions on gists, including listing, forking, starring, creating, |
4 | 4 | #' deleting, updating, etc.
|
5 | 5 | #'
|
6 | 6 | #' There are two ways to authorise gistr to work with your GitHub account:
|
7 |
| -#' |
| 7 | +#' |
8 | 8 | #' \itemize{
|
9 |
| -#' \item Generate a personal access token (PAT) at |
10 |
| -#' \url{https://help.github.com/articles/creating-an-access-token-for-command-line-use} |
11 |
| -#' and record it in the \code{GITHUB_PAT} envar. |
| 9 | +#' \item Generate a personal access token (PAT) at |
| 10 | +#' \url{https://help.github.com/articles/creating-an-access-token-for-command-line-use} |
| 11 | +#' and record it in the \code{GITHUB_PAT} envar. |
12 | 12 | #' \item Interactively login into your GitHub account and authorise with OAuth.
|
13 | 13 | #' }
|
14 |
| -#' |
| 14 | +#' |
15 | 15 | #' Using the \code{GITHUB_PAT} is recommended.
|
16 |
| -#' |
| 16 | +#' |
17 | 17 | #' @importFrom utils browseURL file.edit
|
18 | 18 | #' @importFrom methods is
|
19 | 19 | #' @importFrom stats setNames
|
|
27 | 27 | #' @author Karthik Ram \email{karthik.ram@@gmail.com}
|
28 | 28 | #' @keywords package
|
29 | 29 | NULL
|
| 30 | + |
| 31 | +#' @title Create gists |
| 32 | +#' |
| 33 | +#' @description Creating gists in \code{gistr} can be done with any of |
| 34 | +#' three functions: |
| 35 | +#' |
| 36 | +#' \itemize{ |
| 37 | +#' \item \code{\link{gist_create}} - Create gists from files or code blocks, using |
| 38 | +#' the GitHub HTTP API. Because this function uses the GitHub HTTP API, it does not |
| 39 | +#' work for binary files. However, you can get around this for images by using knitr's |
| 40 | +#' hook to upload images to eg., imgur. In addition, it's difficult to include artifacts |
| 41 | +#' from the knit-ing process. |
| 42 | +#' \item \code{\link{gist_create_git}} - Create gists from files or code blocks, using |
| 43 | +#' git. Because this function uses git, you have more flexibility than with the above |
| 44 | +#' function: you can include any binary files, and can easily upload all artifacts. |
| 45 | +#' \item \code{\link{gist_create_obj}} - Create gists from R objects: data.frame, list, |
| 46 | +#' character string, matrix, or numeric. Uses the GitHub HTTP API. |
| 47 | +#' } |
| 48 | +#' |
| 49 | +#' It may seem a bit odd to have three separate functions for creating gists. |
| 50 | +#' \code{\link{gist_create}} was created first, and was out for a bit, so when we |
| 51 | +#' had the idea to create gists via git (\code{\link{gist_create_git}}) and from R |
| 52 | +#' objects (\code{\link{gist_create_obj}}), it made sense to have a different API for |
| 53 | +#' creating gists via the HTTP API, git, and from R objects. We could have thrown |
| 54 | +#' everything into \code{\link{gist_create}}, but it would have been a massive function, |
| 55 | +#' with far too many parameters. |
| 56 | +#' |
| 57 | +#' @name create_gists |
| 58 | +NULL |
0 commit comments