create_gist: Create a gist in github

Description Usage Arguments Details Value Examples

View source: R/gists.R

Description

This function creates a new gist in GitHub. You can specify one or more files by providing a named list (see examples).

Usage

1
create_gist(files, description, public = FALSE, ...)

Arguments

files

(list) The file contents with the list names as the filenames.

description

(string, optional) A description for the gist.

public

(boolean, optional) Whether the gist is public. Default: FALSE.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

create_gist() returns a list of the gist's properties.

Gist Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
## Not run: 

  # Create a gist with a single file
  create_gist(files = list(hello_world.R = "print(\"Hello World!\")"))

  # Create a gist with multiple files
  create_gist(
    files = list(
      `hello_world.R`    = "print(\"Hello World!\")",
      `hello_world-fn.R` = "helloworld <- function() print(\"Hello World!\")"
    ),
    description = "A new gist"
  )

  # Create a public gist
  create_gist(
    files       = list(hello_world.R = "print(\"Hello World!\")"),
    description = "A new gist",
    public      = TRUE
  )


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.