Description Usage Arguments Details Value Examples
This function updates an existing gist in GitHub. You can specify add or update files by providing a named list and rename a file (see examples).
1 | update_gist(gist, files, description, ...)
|
gist |
(string) The ID of the gist |
files |
(list, optional) The file contents with the list names as the
filenames. Adding a |
description |
(string, optional) A description for the gist. |
... |
Parameters passed to |
For more details see the GitHub API documentation:
update_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 | ## Not run:
# Update a gist's description
update_gist(
gist = "806dca6b09a39e7b6326a0c8137583e6",
description = "An updated description"
)
# Update the contents of a file
update_gist(files = list(hello_world.R = "cat(\"Hello World!\")"))
# Update the contents of a file and the filename
update_gist(
files = list(
hello_world.R = c("cat(\"Hello World!\")", filename = "new_filename.R")
)
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.