Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Installed vignettes show blank tables/plots: self_contained: no drops lt assets on R CMD build

Đang mở Phù hợp với người mới
#171 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
84/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
markdown, r
Lĩnh vực
documentation

Hướng nghiên cứu

Cập nhật các tiêu đề YAML trong 10 vignette HTML bị ảnh hưởng được liệt kê trong issue, đổi self_contained: no thành yes. Bắt đầu bằng cách kiểm tra một vignette được liệt kê và xác nhận cả 10 có cùng thiết lập; sau đó chạy R CMD build . và kiểm tra các tệp inst/doc/*.html đã được tạo. Công việc hoàn tất khi HTML của vignette đã cài đặt bao gồm các tài nguyên cần thiết và các bảng, hình được hiển thị.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Problem

After R CMD build + R CMD INSTALL, opening the installed vignette .html files (inst/doc/*.html) in a browser shows no tables or plots — the interactive AE forest tables and the dot-plot/error-bar figures are missing. The prose renders, but the table area is blank.

Root cause

Every HTML vignette sets self_contained: no in its YAML header:

output:
  rmarkdown::html_document:
    self_contained: no

With self_contained: no, pandoc writes the lt JS/CSS (and other web dependencies) into a <vignette>_files/ sidecar directory and references them with relative <script src="..._files/lt-x.y.z/lt-interactive.js"> tags. R CMD build strips these _files/ sidecar directories from the built package, so the installed .html points at assets that do not exist. No JS loads, and since the lt table is built entirely client-side from an embedded spec, nothing renders.

This is preexisting but only became visible once all table/figure rendering moved to client-side JS (lt); the old static-image paths masked it.

Reproduction
  1. R CMD build . then extract the tarball.
  2. inst/doc/customize-color.html references customize-color_files/lt-*/lt-interactive.js.
  3. No *_files/ directory exists anywhere in the build.
  4. Open the installed .html in a browser → blank table.
Verification
  • Standalone render opened directly in a browser works (deps resolve from the local _files/), which is why this is easy to miss during rmarkdown::render() dev loops.
  • Headless check of the built-tarball inst/doc/customize-color.html confirms the table does not mount.

Fix

Set self_contained: yes (the rmarkdown default) in the affected vignettes so pandoc inlines all JS/CSS into a single standalone .html. The lt assets are small (the old reactable+plotly bulk that likely motivated self_contained: no is gone), so inlining is cheap.

Verified: with self_contained: yes, R CMD build produces inst/doc/*.html with zero external _files/lt references and no sidecar directory; a headless browser renders the table (10 rows) and all 42 inline SVG figures with no JS errors.

Affected files (all 10 HTML vignettes carrying self_contained: no):
customize-ae-specific-columns, customize-color, customize-diff-label, customize-digits, customize-display-only-soc, customize-listing-columns, customize-toggle-buttons, customize-width, customize-xlimit, forestly.

(design-pattern.Rmd uses html_vignette and is unaffected; both forestly.Rmd and design-pattern.Rmd are in .Rbuildignore, so they are not shipped as installed vignettes anyway.)

Ngôn ngữ chính
R
Star
22
Fork
6
Merge trung bình
2 ngày 7 giờ
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Merck/forestly

Tất cả issue của Merck/forestly

Issue tương tự

Thêm issue về R

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.