Description Usage Arguments Details Value Examples
view_files()
summarises files in a table with the properties as columns and
a row for each file in the repository. view_file()
returns a list of all
properties for a single file. browse_files()
and browse_file()
open the
web page for the commit tree and blob respectively in the default browser.
1 2 3 4 5 6 7 | view_files(ref, repo, recursive = TRUE, ...)
view_file(path, ref, repo, ...)
browse_files(ref, repo, ...)
browse_file(path, ref, repo, ...)
|
ref |
(string) Either a SHA, branch or tag used to identify the commit. |
repo |
(string) The repository specified in the format: |
recursive |
(boolean, optional) Whether to list files in subfolders as
well. Default: |
... |
Parameters passed to |
path |
(string) The path to the file, within the repository. |
You can summarise all the milestones of a repository in a specified state
and change the order they are returned using sort
and direction
.
For more details see the GitHub API documentation:
view_files()
returns a tibble of file properties. view_file()
returns a list of properties for a single file. browse_files()
and
browse_file()
opens the default browser on the tree or blob page and
returns the URL.
File Properties:
path: The path to the file within the repository.
sha: The SHA of the file blob.
size: The size of the file in bytes.
html_url: The URL of the blob's web page in GitHub.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | ## Not run:
# View files on the main branch in a repository
view_files("main", "ChadGoymer/githapi")
# View properties of a single file in a repository
view_file(
path = "README.md",
ref = "main",
repo = "ChadGoymer/githapi"
)
# Open the commit's tree page in the default browser
browse_files("main", "ChadGoymer/githapi")
# Open the file's blob page in the default browser
browse_file(
path = "README.md",
ref = "main",
repo = "ChadGoymer/githapi"
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.