r-lib / hugodown

Make websites with hugo and RMarkdown
https://hugodown.r-lib.org
Other
166 stars 24 forks source link

caption syntax #79

Open danmackinlay opened 4 years ago

danmackinlay commented 4 years ago

In standard blogdown the default syntax supports figure captions

![[A girl and her plushie by Bart](https://www.flickr.com/photos/cayusa/2858037869/in/photolist-GkcJmx-7ZdhFy-BYDdfd-5mycbP-BBLDmW-5mycCk-7Za3ZV-6BgA4-5mycqX-5myc5Z-zXDD-57YdkC-35rkdE-7nNE2w/)](/images/girl_cthulhu.jpg)

rendered as

<div class="figure">
<img src="/images/girl_cthulhu.jpg" alt="">
<p class="caption"><a href="https://www.flickr.com/photos/cayusa/2858037869/in/photolist-GkcJmx-7ZdhFy-BYDdfd-5mycbP-BBLDmW-5mycCk-7Za3ZV-6BgA4-5mycqX-5myc5Z-zXDD-57YdkC-35rkdE-7nNE2w/">A girl and her plushie by Bart</a></p>
</div>

AFAICT hugodown will render captions as alt attributes and does not support captioned figures. Is that correct? I should put it in the docs if so (possibly in the features matrix of hugdown vesus blogdown)

maelle commented 4 years ago

Slightly related, to be able to use captions and other options of Hugo's figure shortcode, for rOpenSci I had defined a custom plot hook (I can't remember whether I tested it with hugodown) https://github.com/ropensci/roweb2/blob/master/archetypes/Rmd/index.md#L51