Installed vignettes show blank tables/plots: self_contained: no drops lt assets on R CMD build
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
R CMD build .then extract the tarball.inst/doc/customize-color.htmlreferencescustomize-color_files/lt-*/lt-interactive.js.- No
*_files/directory exists anywhere in the build. - Open the installed
.htmlin 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 duringrmarkdown::render()dev loops. - Headless check of the built-tarball
inst/doc/customize-color.htmlconfirms 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
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Merck/forestly
-
Display of the 4 buttons in the interactive AE forest plotCó thể đã có người làm @yihui đã nhận 7 ngày trước. Đang mở
Merck/forestly#182 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Merck/forestly
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 71/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
OHDSI/PatientLevelPrediction#688 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
rfordatascience/tidytuesday#1098 ·