how to benefit from bookdown features in pkgdown

I would like to use bookdown features like Figures numbering, label/section/... referencing (via \@ref()) when creating a vignette via pkgdown.

It looks like this is possible via vignette's YAML (myvignette.Rmd):

---
title: "My Title"
author: "John Doe"
date: "`r Sys.Date()`"
output:
  bookdown::html_document2:
    base_format: rmarkdown::html_vignette
    toc: true
    toc_depth: 2
    number_sections: false
    fig_caption: true
vignette: >
  %\VignetteIndexEntry{My Title}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

and the as_is field in _pkgdown.yml (see the manual here)

pkgdown:
as_is: true

I have tried on my own package and when I knit locally I get the TOC, Figures numbers

and referenced figures:

referenced-figure

but when built and deploy it, these things are not there.
See it live here or in the snapshot below:

referenced-figure-missing

Anybody has ever succeeded in having bookdown features working in vignette production?
Thanks a lot in advance for any hints, helps.

One idea considering you may have copy-paste this part directly:

is the indentation in your yml the one in your question or the correct one from the manual?

pkgdown:
  as_is: true

Yaml is sensible to indentation and it is possible considering it is not working that the yaml header of your vignette is replace by pkgdown default, that would happen if as_is: true, was not found and used.

It is indented correctly in the _pkgdown.yml file, see github file

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.