Learn R Programming

conflr (version 0.1.1)

confl_create_post_from_Rmd: Publish R Markdown Document to 'Confluence'

Description

Knit and post a given R Markdown file to 'Confluence'.

Usage

confl_create_post_from_Rmd(Rmd_file, interactive = NULL, params = NULL, ...)

confluence_document( title = NULL, space_key = NULL, parent_id = NULL, type = c("page", "blogpost"), toc = FALSE, toc_depth = 7, code_folding = c("none", "hide"), supported_syntax_highlighting = getOption("conflr_supported_syntax_highlighting"), update = NULL, use_original_size = FALSE, interactive = NULL )

Arguments

Rmd_file

Path to an .Rmd file.

interactive

If FALSE, shiny interface is not launched.

params

If provided, a list of named parameters that override custom params in the YAML front-matter.

...

Arguments passed to confluence_documents().

title

Title of the post.

space_key

The space key to find content under.

parent_id

The page ID of the parent pages.

type

The content type to return. Default value: page. Valid values: page, blogpost.

toc

If TRUE, include a table of contents in the output.

toc_depth

The max level of headers to include in the table of contents.

code_folding

If "hide", fold code blocks by default.

supported_syntax_highlighting

A named character vector of supported syntax highlighting other than default (e.g. c(r = "r")).

update

If TRUE, overwrite the existing page (if it exists).

use_original_size

If TRUE, use the original image sizes.

Value

confl_create_post_from_Rmd() returns the URL of the published page.

confluence_document() returns an rmarkdown_output_format object.

Details

All options of confluence_document() can also be specified via the argument of confl_create_post_from_Rmd. If an option is specified on both, the one given as an argument will be used.

---
title: "title1"
output:
  confluence_document:
    space_key: "space1"
    parent_id: 1234
    toc: TRUE
    toc_depth: 4
    code_folding: hide
    supported_syntax_highlighting:
      r: r
      foo: bar
    update: true
    use_original_size: true
---

...

Examples

Run this code
# NOT RUN {
example_Rmd <- system.file("extdata/example.Rmd", package = "conflr")

# }
# NOT RUN {
# Convert an R Markdown document into a 'Confluence' page interactively
confl_create_post_from_Rmd(example_Rmd)

# You can override most of the parameters of confluence_document()
confl_create_post_from_Rmd(example_Rmd, space = "space1", toc = TRUE)
# }
# NOT RUN {
# }
# NOT RUN {
# A custom R markdown format that can be passed to rmarkdown::render()
format <- confluence_document(space_key = "space1")
rmarkdown::render(system.file("extdata/example.Rmd", package = "conflr"), format)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab