post_new_article: Post a markdown file to dev.to

Description Usage Arguments Details Value See Also Examples

View source: R/post_new_article.R

Description

Create a new post from an .Rmd.

Usage

1

Arguments

file

The path to the file

key

Your API key, Default: NA

Details

Will look for an api key in the '.REnviron' file. Seems to check if the body is identical to a previous article and error if so with '"Body markdown has already been taken"'. The following YAML arguments are read from the file YAML frontmatter if present:

title

A character string

series

A character string

published

A boolean

tags

list of character strings: ["tag1", "tag2"]

dev.to will not allow tags with spaces, so tags with spaces will be automatically collapsed.

The default table output method renders a very large print code block. The workaround is to use kable.

Value

The response

See Also

yaml_front_matter,render read_file str_remove glue POST,add_headers,content

Examples

1
2
3
4
5
6
## Not run: 
if(interactive()){
 post_new_article("./articles/my_article.Rmd")
 }

## End(Not run)

DaveParr/dev.to.ol documentation built on Aug. 8, 2020, 4:31 p.m.