quarto-dev / quarto-cli

Open-source scientific and technical publishing system built on Pandoc.
https://quarto.org
Other
3.81k stars 310 forks source link

`df-print` ignored on Confluence #7605

Open dpprdan opened 10 months ago

dpprdan commented 10 months ago

Bug description

When publishing to Confluence, the df-print option [kable, tibble, paged] is ignored. (It is applied to the preview, however, and at least kable and tibble outputs are possible on Confluence. I haven't tested, whether paged is supported on Confluence).

Steps to reproduce

Publish the following to Confluence:

---
title: "confluence df-print kable"
format: 
  confluence-html:
    df-print: kable
---

```{r}
head(mtcars)

### Expected behavior

The table output is rendered as specified in `df-print` (as in the preview, in this case (`kable`) like a markdown table):

![grafik](https://github.com/quarto-dev/quarto-cli/assets/1423562/3bcaf052-8156-4eba-9463-67907ceab088)

### Actual behavior

The table output is rendered with the default S3 method for the data frame.

![grafik](https://github.com/quarto-dev/quarto-cli/assets/1423562/cf2daa07-38cb-40c8-ae37-bd6b1000cf90)

### Your environment

─ Session info ──────────────────────────────── setting value version R version 4.3.2 (2023-10-31 ucrt) os Windows 11 x64 (build 22631) system x86_64, mingw32 ui RStudio language en collate German_Germany.utf8 ctype German_Germany.utf8 tz Europe/Berlin date 2023-11-16 rstudio 2023.09.1+494 Desert Sunflower (desktop) pandoc 3.1.9 @ C:\PROGRA~1\Pandoc\pandoc.exe


### Quarto check output

dpprdan@Notebook-DP MINGW64 ~/Documents/R/quarto-test $ quarto check

[>] Checking versions of quarto binary dependencies... Pandoc version 3.1.1: OK Dart Sass version 1.55.0: OK [>] Checking versions of quarto dependencies......OK [>] Checking Quarto installation......OK Version: 1.3.450 Path: C:\Program Files\Quarto\bin CodePage: 1252

[>] Checking basic markdown render....OK

[>] Checking Python 3 installation....(None)

Unable to locate an installed version of Python 3. Install Python 3 from https://www.python.org/downloads/

[>] Checking R installation...........OK Version: 4.3.2 Path: C:/PROGRA~1/R/R-43~1.2 LibPaths:

[>] Checking Knitr engine render......OK

cderv commented 10 months ago
---
title: "confluence df-print kable"
format: 
  confluence-html:
df-print: kable
---

Can you try putting this at top level ?

When you publish, it will internally use a specific publish format which produce the XML that is sent with API to Confluence. This internal format does know about your df-print option that is under confluence-html.

if you put it at top level, it should apply as execute option for all format, not just confluence-html preview format.

Thanks

dpprdan commented 10 months ago

Yes, this works, i.e. the table is now published as a kable table. 🎉

So what remains is a documentation issue? At least I wouldn't have thought of putting the df-print option at the top level (is this just a quarto feature or was it already possible with rmarkdown?). Also "works in confluence-html but doesn't in Confluence XML when specified at a sublevel" is confusing.

Maybe it would also useful to delineate which html options are available on confluence and which aren't, cf. https://github.com/quarto-dev/quarto-cli/discussions/7193? Especially since confluence-html != Confluence XML.

mcanouil commented 10 months ago

It was already possible in rmarkdown, see https://bookdown.org/yihui/rmarkdown/html-document.html#data-frame-printing.

cderv commented 10 months ago

(is this just a quarto feature or was it already possible with rmarkdown?).

df_print is as option from R Markdown yes. however R Markdown and Quarto works differently on options. It is only possible with Quarto to put such option at the top level, because Quarto will assign any option key to the right place.

Also "works in confluence-html but doesn't in Confluence XML when specified at a sublevel" is confusing.

This could be a bug or mis-documented feature. confluence-html is a preview format really. When you publish, it will produce some XML content, not HTML. Any option set for confluence-html seems to not be passed or work when publishing.

Maybe it would also useful to delineate which html options are available on confluence and which aren't, cf. https://github.com/quarto-dev/quarto-cli/discussions/7193? Especially since confluence-html != Confluence XML.

And yes this is exactly the problem and what needs to be improved !