Skip to content
This repository was archived by the owner on Sep 2, 2025. It is now read-only.

Commit 57f13a7

Browse files
committed
added man file to describe the different create gist fxns
1 parent a4739b8 commit 57f13a7

File tree

3 files changed

+69
-9
lines changed

3 files changed

+69
-9
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Description: Work with 'GitHub' 'gists' from 'R' (e.g.,
99
your default browser, get embed code for a 'gist', list 'gist' 'commits', and
1010
get rate limit information when 'authenticated'. Some requests require
1111
authentication and some do not. 'Gists' website: https://gist.github.com/.
12-
Version: 0.3.1.9000
12+
Version: 0.3.1.9100
1313
Authors@R: c(
1414
person("Ramnath", "Vaidyanathan", role = "aut", email = "[email protected]"),
1515
person("Karthik", "Ram", role = "aut", email = "[email protected]"),

R/gistr-package.R

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#' 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,
44
#' deleting, updating, etc.
55
#'
66
#' There are two ways to authorise gistr to work with your GitHub account:
7-
#'
7+
#'
88
#' \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.
1212
#' \item Interactively login into your GitHub account and authorise with OAuth.
1313
#' }
14-
#'
14+
#'
1515
#' Using the \code{GITHUB_PAT} is recommended.
16-
#'
16+
#'
1717
#' @importFrom utils browseURL file.edit
1818
#' @importFrom methods is
1919
#' @importFrom stats setNames
@@ -27,3 +27,32 @@
2727
#' @author Karthik Ram \email{karthik.ram@@gmail.com}
2828
#' @keywords package
2929
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

man/create_gists.Rd

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
% Generated by roxygen2 (4.1.1): do not edit by hand
2+
% Please edit documentation in R/gistr-package.R
3+
\name{create_gists}
4+
\alias{create_gists}
5+
\title{Create gists}
6+
\description{
7+
Creating gists in \code{gistr} can be done with any of
8+
three functions:
9+
10+
\itemize{
11+
\item \code{\link{gist_create}} - Create gists from files or code blocks, using
12+
the GitHub HTTP API. Because this function uses the GitHub HTTP API, it does not
13+
work for binary files. However, you can get around this for images by using knitr's
14+
hook to upload images to eg., imgur. In addition, it's difficult to include artifacts
15+
from the knit-ing process.
16+
\item \code{\link{gist_create_git}} - Create gists from files or code blocks, using
17+
git. Because this function uses git, you have more flexibility than with the above
18+
function: you can include any binary files, and can easily upload all artifacts.
19+
\item \code{\link{gist_create_obj}} - Create gists from R objects: data.frame, list,
20+
character string, matrix, or numeric. Uses the GitHub HTTP API.
21+
}
22+
23+
It may seem a bit odd to have three separate functions for creating gists.
24+
\code{\link{gist_create}} was created first, and was out for a bit, so when we
25+
had the idea to create gists via git (\code{\link{gist_create_git}}) and from R
26+
objects (\code{\link{gist_create_obj}}), it made sense to have a different API for
27+
creating gists via the HTTP API, git, and from R objects. We could have thrown
28+
everything into \code{\link{gist_create}}, but it would have been a massive function,
29+
with far too many parameters.
30+
}
31+

0 commit comments

Comments
 (0)