kr_add: Add a post to a knowledge repository

Description Usage Arguments Details Examples

Description

Add a local file to a knowledge repository. Unless submit = TRUE, this doesn't (yet) submit the post.

Usage

1
2
3
kr_add(filename, path = NULL, update = FALSE, branch = NULL,
  squash = FALSE, submit = FALSE, message = NULL, src = NULL,
  browse_pr = FALSE, ..., repo = Sys.getenv("KNOWLEDGE_REPO"))

Arguments

filename

Filename to add

path

The path of the destination post to be added in the knowledge repo. Required if the knowledge post does not specify "path" in its headers.

update

Whether this should update an existing post of the same name.

branch

The branch to use for this addition, if not the default (which is the path of the knowledge post).

squash

Automatically suppress all previous commits, and replace it with this version.

submit

Submit newly added post.

message

Commit message. By default, will use 'Adding post: [title]'

src

Specify additional source files to add to <knowledge_post>/orig_src.

browse_pr

If submit, whether to browse to a GitHub pull request for submitting this post.

...

Global arguments to knowledge_repo commands, such as repo or noupdate (see Details)

repo

Repository of the knowledge post to add

Details

Global arguments that can be passed to all knowledge_repo commands include:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# set up a repository and post
repo <- tempfile()
kr_init(repo)
kr_create("test.Rmd", repo = repo)

# add to knowledge repo
kr_add("test.Rmd", repo = repo, path = "tests/test")

# custom commit message
kr_add("test.Rmd", repo = repo, path = "tests/test2", message = "Committing a new post")

dgrtwo/knowledgerepo documentation built on May 25, 2019, 4:23 p.m.