Git Product home page Git Product logo

conflr's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

conflr's Issues

Release conflr 0.1.0

Prepare for release:

  • Check that description is informative
  • Check licensing of included files
  • usethis::use_cran_comments()
  • devtools::check()
  • devtools::check_win_devel()
  • rhub::check_for_cran()
  • Polish pkgdown reference index
  • Draft blog post

Submit to CRAN:

  • usethis::use_version('minor')
  • Update cran-comments.md
  • devtools::submit_cran()
  • Approve email

Wait for CRAN...

  • Accepted ๐ŸŽ‰
  • usethis::use_github_release()
  • usethis::use_dev_version()
  • Update install instructions in README
  • Finish blog post
  • Tweet
  • Add link to blog post in pkgdown news menu

Single sign on

How can I use this package to access an installation that doesn't support user-password authentication? Is this a mode of operation you would support?

Images displayed on "large" size instead of original

First off, thanks for your work on this package, I'm very excited about it!

After trying to upload a page, I noticed that all the images were resized to "large" in confluence causing them to become unreadable/not match the preview. Is it possible to set them to display at "original" size without manually editing the page?

Thanks!

conflr with Plotly

Plotly is a great and versatile plotting tool for R, especially in R markdown.

I think conflr does not currently support plotly graphs...

However, this would be a fantastic addition to an awesome and much needed tool!

convenient access to pageID and space names ?

Thanks for this great package I think it'll help me a lot.

Maybe I'm using the wrong workflow but I'm experiencing some awkwardness with space names and page ids.

As a test I opened a confluence page and decide to use it as a parent for the page I wish to create. I believe the full information is in the url, however I have to extract the space name (easy enough as it's in my url), and find the page id, which I do by finding the page nformation here :

image

Then copy paste the id from the URL, Is there a way to get the pageId and space right from the url ? Or maybe even better, could I provide in the UI the url instead of space and pageID ?

Now the other way around, I wanted to delete the page I created (or maybe I'd want to use it as a new parent), but I don't know its id, so I have to go manually on the page and do the same process.

The most convenient option for me would be to have the choice between inputing space and pageId, or just inputing an "url" parameter. In any case a get_pageId_from_url() function would help.

I'd also appreciate having the pageId logged in the console when running confl_create_post_from_Rmd_addin(), and returned invisibly by confl_create_post_from_Rmd()

Again apologies if I'm just using it wrong, and looking forward for the CRAN release.

Wrong escaping of CDATA

Example document:

---
title: "test page"
output:
  conflr::confluence_document:
    space_key: "***"
---

<ac:structured-macro ac:name="expand">
  <ac:parameter ac:name="title">hidden stuff below</ac:parameter>
  <ac:rich-text-body><![CDATA[<p>foo</p>]]></ac:rich-text-body>
</ac:structured-macro>

Note the CDATA section for passing in HTML.

This fails with:

Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html,  : 
  Opening and ending tag mismatch: confl-ac-rich-text-body line 1 and p [76]
Calls: render ... read_xml.character -> read_xml.raw -> doc_parse_raw

And renders a markdown file as:

<ac:structured-macro ac:name="expand"> <ac:parameter ac:name="title">hidden stuff below</ac:parameter> <ac:rich-text-body><![CDATA[<p>foo

</p>

\]\]\></ac:rich-text-body> </ac:structured-macro>

Note that the closing tag of the CDATA is somehow got escaped.

Not sure what's causing the problem, as conflr:::restore_cdata seems to match it and run correctly (after patching to work with rich-text-body as well besides plain-text-body), but some other mechanism might mess up the closing CDATA tag later on in the process?

Regression: raw tags should not be escaped

This should add TOC, not a string of "<ac:structured-macro ac:name="toc" ac:schema="1"></ac:structured-macro>"

---
title: test
---

```{r echo=FALSE}
library(htmltools)
p(tag("ac:structured-macro",list("ac:name"="toc", "ac:schema"="1")))
```

### A

### B

### C

Disables some data.table functionality

Hi,
I really like the project by the way. Thank you very much for sharing it. You had a data.table issue a while back that you couldn't recreate so I've supplied a sample that fails.

I've attached a txt file - just change the extension to .rmd. The data.table operations work under knitr but fail under conflr saying that dt is not a data.table.

TestDataTable.txt

Add dynamic title functionality

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')`"
---

Error in doc_parse_raw() when using manual <br> page breaks

I'm getting an error when trying to post a markdown file that includes manual page breaks (<br>) in it. See the reproducible example below.

library(conflr)
md_text <- c("`Test Markdown`",
             "==============",
             "",
             "This is a test file.",
             "<br>",
             "It has a break in it.")
html_text <- commonmark::markdown_html(md_text)


page <- confl_update_page(
  id = "244877109",
  title = "Test",
  body = html_text)
#> Error in doc_parse_raw(x, encoding = encoding, base_url = base_url, as_html = as_html, : Opening and ending tag mismatch: br line 3 and p [76]

Created on 2019-03-08 by the reprex package (v0.2.1)

It looks like this error occurs in the private function translate_to_confl_macro, specifically in line 2 below:

html_doc <- xml2::read_xml(html_text, options = c("RECOVER", "NOERROR", "NOBLANKS"))

It seems like I can resolve this error by replacing xml2::read_xml with xml2::read_html, which doesn't seem to check to make sure every tag has a closing pair (which is not needed for manual breaks using <br>).

Is it possible to replace xml2::read_xml with xml2::read_html in the package source?

Support code folding

This is easy with expand macro.

<ac:structured-macro ac:name="expand">
  <ac:parameter ac:name="title">title1</ac:parameter>
  <ac:rich-text-body>
    <p>aaa</p>
  </ac:rich-text-body>
</ac:structured-macro>

Option to turn off "Notify watchers"

Hi,

First of - 'conflr' is a real time saver for me!
Your work is appreciated!

I am facing similar issue are described here:
https://jira.atlassian.com/browse/CONFSERVER-38804

i.e. watchers are being notifed not only when I post new page but also when I add content or modify it. This seems to be resulting in sending notification each time I invoke knitr::include_graphics().
According to the link provided this ca be partially solved by using "minorEdit" : true .
Do you plan on implementing it or having any other workaround for the problem ?

Best regards,
P.

Error when I try to publish page on Confluence

Hello !

Everything works fine until I try to "publish" my page on confluence. The process seems to be stuck and I have only one warning which is not very helpful :

Warning: Error in : Condition message must be a string
86: <Anonymous>

I integrate "confluence_document: " on my rmarkdown, I log in to confluence directly on the command line, I have access to the preview before publishing. It's just when I click on "Publish" that the issue appears. I use the following parameters :

    parent_id: 436666369
    toc: TRUE
    toc_depth: 4
    code_folding: hide
    supported_syntax_highlighting:
      r: r
      foo: bar
    update: true 
    use_original_size: true 

Does anyone have any idea ?

Hello how can I create/update a confluence page from the R console ?

Hello, I am using the nvimr plugin and not Rstudio.
I'd like to be able to create/update a confluence page from the R console.
I tried to do

R> conflr::confl_create_post_from_Rmd(here::here("fi_aware.Rmd")) 
Error: RStudio not running
In addition: Warning message:
In stop(e, call. = FALSE) : additional arguments ignored in stop()

Is there a function I can use that would be like

conflr::confl_create_post_from_Rmd(Rmd_file, spaceId, username, ...)

that would allow me to work without any rstudio ?

Add support for language option in confluence code block macro

Currently, it seems the language of an rmarkdown code chunk is lost in translation between the Rmd to md conversion, and then can't be reported to html conversion, and finally confluence post processing of html to create xml storage format.

However, it is possible to add the option to code block macro using

<ac:structured-macro ac:name="code">
  <ac:parameter ac:name="language">r</ac:parameter>
  <ac:plain-text-body><![CDATA[this is my code]]></ac:plain-text-body>
</ac:structured-macro>

https://confluence.atlassian.com/conf59/code-block-macro-792499083.html#CodeBlockMacro-Storageformatexample

I think it could be possible to add such support. I can look into it, but first what do you think ?
Did you already try something ?

Thanks.

confluence_document

Probably we can do this by setting some post_processor.

---
title: "foo"
output:
  confluence_document:
    space_key: "my_space"
    parent_id: "123456789"
    ...
---

Warning: Error in parse_url: length(url) == 1 is not TRUE

Hi. I tried to post to our company Confluence page yesterday and am experiencing the error above. I'm not sure if it's an issue per se or just unique to my set up, any guidance would be much appreciated.

Duplicate post on rstudio community: https://community.rstudio.com/t/conflr-errors-when-trying-to-publish-a-rmd-page-to-confluence/61832

I have created a Rmd doc and using output: github_document I was also able to generate a readme for a Github repo.

Some folk in our company do not have access to Github and they wouldlike me to publish the Rmd documentation of a project to Confluence. I found the https://github.com/line/conflr library for doing this.

I've followed the set up guidelines and added global variables to my .Renviron, including

CONFLUENCE_URL="https://confluence.somecompany.com"
CONFLUENCE_USERNAME="doug"
CONFLUENCE_PASSWORD="[my pass]"

I then used the conflr add in to attempt to post to a page. I entered the Space of the page which is called 'Analytics' and then the parent page ID (Which I found after clicking on 'page info' in Confluence on the parent page I'd like to post to). After I click publish I get this output in the console:

No encoding supplied: defaulting to UTF-8.
Listening on http://127.0.0.1:3415
No encoding supplied: defaulting to UTF-8.
No encoding supplied: defaulting to UTF-8.
No encoding supplied: defaulting to UTF-8.
Warning: Error in parse_url: length(url) == 1 is not TRUE
65:

I tried Google searching for this error but did not find anything in relation to it within the context of conflr. How should I interpret this error and how can I overcome it?

I tried some other functions from the package just to see if it recognized by credentials in .Renviron (I restarted R after updating .Renviron with my credentials).

e.g. list pages in a space

confl_list_pages(spaceKey = 'Analytics')
No encoding supplied: defaulting to UTF-8.
{html_document}
<html>
[1] <head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">\n<title>Sign in ใƒป Cloudflare Access</title ...
[2] <body>\n    <div class="Surface">\n      <div class="AuthBox">\n        <div class="AuthBox-body">\n          <a class ...

I'm not sure if this means there's a successful read of my credentials or not?

How can I post my Rmd file to Confuence?

Cannot upload LaTex

I can not use conflr to upload LaTex.

here is my latex content:

$$ y = \frac {1 }{2}$$

result in wiki:

image

it seems that the latex macro is wrong

URL from published page no longer returned

Hello!

It looks like confl_create_post_from_Rmd() no longer returns the URL of the published page? Is there a way to get that URL still? I was sending it along with an alert that a page was published.

Thanks!

Hide warning about missing personal space

The default value of the Shiny UI component for the Confluence space is the user's personal space. The conflr package attempts to use the username as the space key, but personal spaces often a numeric space key (see here).

It would be good to suppress the warning message like:

Warning message:
In confl_verb("GET", glue::glue("/space/{spaceKey}"), query = purrr::compact(query)) :
  Error in stop(httr::http_condition(res, type = "error"), httr::content(res)): Not Found (HTTP 404).
404list(authorized = FALSE, valid = TRUE, errors = list(), successful = FALSE)No space found with key : ~david.hall

Support update wiki from Rmarkdown

currently, I can not update an existing Wiki by conflr directly.

I wish to use conflr in Rscript and directly update the content with function.

it looks like this:

conflr::confl_login(username = "xxx",passwd = "xxx",url = "xxx.com")
conflr::confl_update_post_from_Rmd("test.Rmd",space = "xxx",page_id = 123456)

Images are uploaded but dont show up in page

I am using knitr::include_graphics() with .png files to include graphics in the confluence page. The images are uploaded but don't show up in the page. I am able to manually edit the page to put the images in without having to re-upload them.

Support toc_depth

maxLevel seems the corresponding parameter.

<ac:structured-macro ac:name="toc">
  <ac:parameter ac:name="maxLevel">3</ac:parameter>
</ac:structured-macro>

Add Hex Sticker

conflr is great package to talk to Wiki in my daily job. Wish someone can propose a lovely hex sticker like bookdown logo.

Call to confl_create_post_from_Rmd (not interactive) returns browser error

When I call confl_create_post_from_Rmd(interactive=F) from a terminal R session, I receive the following error.

Error in browseURL(result_url) : 
  'browser' must be a non-empty character string

The function works when I call it from the command line in R studio, opening a browser with the created page. But this is a behavior I do not need or want in "Batch Use". I want to create large numbers of pages without R attempting to open a browser to them.
I troubleshooted in two ways.
First, I tried setting the environmental variable R_BROWSER=FALSE in my .Rprofile (to suppress showing URLs altogether).
Second, I commented out #readLines(paste0(output_file, "_result_url"), warn = FALSE) in the function and had it return a number. This produced another error message.
I think the issue is the render function in rmarkdown.

Can I use this function or your package to create / publish pages without R trying to open the page in a browser?

Unexpected close tag?

Getting an error when trying to publish. Not sure if related to #45 ?

Listening on http://127.0.0.1:7685
Warning: Error in confl_verb: Error in stop(httr::http_condition(res, type = "error"), httr::content(res)): Bad Request (HTTP 400).
400list(authorized = FALSE, valid = TRUE, errors = list(), successful = FALSE)com.atlassian.confluence.api.service.exceptions.BadRequestException: Error parsing xhtml: Unexpected close tag </ac:structured-macro>; expected </p>.
 at [row,col {unknown-source}]: [22,21]
  78: stop
  77: confl_verb
  76: confl_update_page
  75: observeEventHandler
   4: shiny::runApp
   3: shiny::runGadget
   2: confl_addin_upload
   1: conflr::confl_create_post_from_Rmd

Using conflr does not seem to work well with data.table

I looks like when I use data.table in the Rmd that I want to push on confluence I get issues with data.table. Typically the attributes of the data.table might be messed up.
I add similar issues before when writing my own packages and I had to add Depends: data.table in DESCRIPTION

Support tabset

This might be good to have, but this requires non-default macro. What's tougher is that the type of macro is different between the Server version and the Cloud version...

<ac:structured-macro ac:name="deck">
  <ac:parameter ac:name="id">card1</ac:parameter>
  <ac:rich-text-body>
    <ac:structured-macro ac:name="card">
      <ac:parameter ac:name="label">aaa</ac:parameter>
      <ac:rich-text-body>
        <p>aaa</p>
      </ac:rich-text-body>
    </ac:structured-macro>

    <ac:structured-macro ac:name="card">
      <ac:parameter ac:name="label">bbb</ac:parameter>
      <ac:rich-text-body>
        <p>bbb</p>
      </ac:rich-text-body>
    </ac:structured-macro>
  </ac:rich-text-body>
</ac:structured-macro>

Merge addin.R and console.R

As we keep adding many features, I think it's a matter of time until they get diverged and behave inconsistently. Let's figure out the steps needed and merge these two files.

Support TOC

Add this tag

<ac:structured-macro ac:name="toc" />

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.