Column sizing issue with pkgdown and listviewer in view mode

I am working on an R package and using pkgdown to build the documentation. I have a multi-level list that I'd like to view and am using the listviewer package with listviewer::jsonedit to display the list. In view mode (also form mode), the list appears to have some sort of sizing issue - the width of the list dynamically resizes, but is not wide enough to display the contents of the list appropriately. This appears to only be an issue when used in view mode with pkgdown (knitr renders fine in the markdown preview, it displays fine in the RStudio viewer fine, no issue with tree or other modes besides view and form). I have not modified any of the pkgdown defaults. I tried inspecting the HTML, but couldn't figure out what was controlling the column widths...

Given the above, I think there may be something going on specifically with pkgdown or htmlwidgets?

Any ideas on why this might be happening?

reprex:


    ---
    title: "test_vignette"
    output: rmarkdown::html_vignette
    vignette: >
      %\VignetteIndexEntry{test_vignette}
      %\VignetteEngine{knitr::rmarkdown}
      %\VignetteEncoding{UTF-8}
    ---
    
    ```{r out.width = 800}
    
    test_list = list(
        a = list(
          a1 = 'a1 text',
          a2 = list(
            a2a = 'a2a text',
            a2b = 'a2b text',
            a2c = list(
              a2c1 = 'a2c1 text',
              a2c2 = 'a2c2 text'
              )
          )
        ),
        b = list(
          b1 = 'b1 text',
          b2 = list(
            b2a = 'b2a text',
            b2b = 'b2b text',
            b2c = list(
              b2c1 = 'b2c1 text',
              b2c2 = 'b2c2 text'
              )
          )
        )
    )
    
    listviewer::jsonedit(test_list,
                         mode = 'view')
    ```

Pkgdown vignette (list not expanded) - not good:
image

Pkgdown vignette (list expanded) - not good:
expanded list (not good)

RStudio viewer (similar for knitr) - good:
image

This topic was automatically closed after 45 days. 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.