Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Add dynamic title functionality #106

Open
magooken opened this issue May 7, 2020 · 4 comments
Open

Add dynamic title functionality #106

magooken opened this issue May 7, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@magooken
Copy link

magooken commented May 7, 2020

When I tried to use a YAML param to create a dynamic title, it showed up fine when I knit it, but in the confluence page, it just showed the R code. (added quotes to syntax for formatting)

---
output: html_document
params:
  peril: 'Peril Name'
  version: 0.03
title: "`r paste0(params$peril,' - v', params$version,'a')`"
---
@yutannihilation
Copy link
Contributor

Hmm, curious. Thanks for reporting.

@yutannihilation
Copy link
Contributor

@magooken
Sorry, I couldn't reproduce your problem. On my Confluence the page is titled as intended ("Peril Name - v0.03a"). Do you use the latest CRAN version of conflr?

@magooken
Copy link
Author

Thank for looking into this. I'm using version 0.1.1 in R 3.5.3. Does it matter how I'm knitting it? I'm using an Rscript call to conflr::confl_create_post_from_Rmd.

@yutannihilation
Copy link
Contributor

Aw, thanks for the detail! I used addin so this is the difference.

For a reason conflr::confl_create_post_from_Rmd() is a bit tricky, so I need to think if I really can fix this issue properly.

Meanwhile, I have two possible workarounds in my mind:

One is to override title in the script.

conflr::confl_create_post_from_Rmd("path/to/Rmd", title = paste0(...))

But, you are trying to use param in the Rmd, so it seems not the case...

Another is use conflr::confluence_document instead of html_document so that you can just rmarkdown::render() instead of conflr::confl_create_post_from_Rmd().

---
output:
  conflr::confluence_document:
    space_key: "..."
    update: true
params:
  peril: 'Peril Name'
  version: 0.03
title: "`r paste0(params$peril,' - v', params$version,'a')`"
---

@yutannihilation yutannihilation added the bug Something isn't working label May 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants