conflr is an R package to post R Markdown documents to Confluence, a content collaboration tool by Atlassian.
devtools::install_github("line/conflr")
Set CONFLUENCE_URL
to the Confluence endpoint in .Renviron
(you can
open the file with usethis::edit_r_environ()
).
CONFLUENCE_URL=https://confluence.example.com
(Caution for those who are not familiar with R Markdown: R Markdown’s powerfulness allows you to execute arbitrary codes; be sure about what the code does before clicking “Post to Confluence”!)
- type: page or blogpost
- Space Key: key for the space
- Parent page ID: (optional) page ID to which the new page will belong
library(conflr)
# list pages
res <- confl_list_pages(spaceKey = "foo")
purrr::map_chr(res$results, "id")
# get page info
page <- confl_get_page(res$results[[2]]$id)
page$title
# create a page
new_page <- confl_post_page(
spaceKey = "foo",
title = "Test",
body = glue::glue(
'<ac:structured-macro ac:name="code">
<ac:plain-text-body><![CDATA[this is my code]]></ac:plain-text-body>
</ac:structured-macro>
'))
new_page$`_links`
See CONTRIBUTING.md
Copyright (C) 2019 LINE Corporation
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, version 3.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
See LICENSE.md for more detail.