Description Usage Arguments Details Value Examples
This function creates a new gist in GitHub. You can specify one or more files by providing a named list (see examples).
1 | create_gist(files, description, public = FALSE, ...)
|
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:
|
... |
Parameters passed to |
For more details see the GitHub API documentation:
create_gist()
returns a list of the gist's properties.
Gist Properties:
id: The id for the gist
description: The description of the gist
files: A tibble of file properties:
filename: The name of the file
type: The type of file
content: The file content
size: The size of the file in bytes
truncated: Whether the file content has been truncated
owner: The login if the gist's owner
public: Whether the gist is public
html_url: The address of the gist's web page.
created_at: The time and date the gist was created.
updated_at: The time and date the gist was last updated.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.