Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add caption-hiding option à la html_document #97

Open
batpigandme opened this issue Apr 5, 2021 · 5 comments
Open

Add caption-hiding option à la html_document #97

batpigandme opened this issue Apr 5, 2021 · 5 comments

Comments

@batpigandme
Copy link

batpigandme commented Apr 5, 2021

Per discussion with @jennybc, and somewhat related to #79, it would be nice to:

  1. Ultimately separate out what constitutes a caption vs alt-text (since they're not really the same)—though that might be something worth addressing upstream in the rmarkdown stack.
  2. In the meantime, add the option as it currently exists for html_document to hide or show the caption using fig_caption: false in the yaml (see bookdown docs here).

Closest thing I found in rmarkdonw/knitr stack was yihui/knitr@42b91f0

@cderv
Copy link

cderv commented Apr 5, 2021

There is now a fig.alt= chunk option in knitr that allows for HTML to differentiate alt text from caption (fig.cap chunk option), and even allows to not have a caption but have an alt text.

Would that help here ?
Otherwise, I am interested to understand better why and see what we could do in the rmarkdown stack as you suggest.

@jennybc
Copy link
Member

jennybc commented Apr 5, 2021

I think it's (somewhat) a documentation problem. I googled "alt text rmarkdown" and ended up here:

https://bookdown.org/yihui/rmarkdown-cookbook/html-accessibility.html

which only tells me about fig_caption: false = FALSE for html_document(). I didn't realize fig.alt exists.

@batpigandme
Copy link
Author

Same page as Jenny. I think it's just a matter of a PR to the rmarkdown cookbook.

@cderv
Copy link

cderv commented Apr 6, 2021

Agreed.

For the context, it is really new, as just added in last knitr release 2 months ago (v1.31), and we're late on the first 2021 round up blog post on RStudio blog. knitr docs is updated though but it does not contains a "news" section, and it seems it does not come out in search.

We're still working on better communication. Also R Markdown Cookbook (and others books) are not yet updated as soon as a new feature is out.

Thanks for the feedback

@apreshill
Copy link
Collaborator

Blog post on this chunk option just published: https://blog.rstudio.com/2021/04/20/knitr-fig-alt/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants