quarto-dev / quarto-dev/quarto-cli
FR: Forward additional attributes from code cells to FloatRefTarget nodes
Open
@cscheid is already working on this.
Since Feb 9, 2024.
crossref
enhancement
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Bug description
I am creating a custom output for figures and tables that depends on custom attributes. FloatRefTarget has custom attributes for for tables but not for figures.
Steps to reproduce
---
format:
html:
filters:
- myfilter.lua
---
```{r tbl-mytable}
#| tbl-cap: My caption
#| myattribute: value
data.frame(Numbers = seq(1,2), Letters = c("A", "B")) |>
knitr::kable()
```
```{r fig-myfigure}
#| fig-cap: My caption
#| myattribute: value
plot(1:3)
```
--myfilter.lua
FloatRefTarget = function(float)
quarto.log.output(float.type)
quarto.log.output(float.attributes)
end
Expected behavior
quarto.log.output:
Table
List {myattribute: "value"}
Figure
List {myattribute: "value"}
Actual behavior
quarto.log.output:
Table
List {myattribute: "value"}
Figure
List {}
Your environment
- IDE: RStudio 2023.06.01+524
- OS: Windows 11 Home
Quarto check output
Quarto 1.5.9
[>] Checking versions of quarto binary dependencies...
Pandoc version 3.1.11: OK
Dart Sass version 1.69.5: OK
Deno version 1.37.2: OK
[>] Checking versions of quarto dependencies......OK
[>] Checking Quarto installation......OK
Version: 1.5.9
Path: C:\Program Files\Quarto\bin
CodePage: 1252
[>] Checking tools....................OK
TinyTeX: (not installed)
Chromium: (not installed)
[>] Checking LaTeX....................OK
Tex: (not detected)
[>] Checking basic markdown render....OK
[>] Checking Python 3 installation....OK
Version: 3.11.3
Path: C:/Users/renee/AppData/Local/Programs/Python/Python311/python.exe
Jupyter: 5.3.1
Kernels: python3
[>] Checking Jupyter engine render....OK
[>] Checking R installation...........OK
Version: 4.3.2
Path: C:/PROGRA~1/R/R-4.3.2
LibPaths:
- C:/Users/renee/AppData/Local/R/win-library/4.3
- C:/Program Files/R/R-4.3.2/library
knitr: 1.45
rmarkdown: 2.25
[>] Checking Knitr engine render......OK
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.