knit-rmd-html

Solid

Knit/render R Markdown (.Rmd) to HTML reliably in this repo (auto-bootstrap pandoc, set correct knit_root_dir, and run rmarkdown::render via a Python wrapper).

Data & Documents 48 stars 7 forks Updated today MIT

Install

View on GitHub

Quality Score: 86/100

Stars 20%
56
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Knit Rmd → HTML(项目高频场景) ## 目标 Knit/render R Markdown (.Rmd) to HTML reliably in this repo (auto-bootstrap pandoc, set correct knit_root_dir, and run rmarkdown::render via a Python wrapper). 当用户说"knit 出 html / render Rmd / 生成 HTML 报告"时使用本 skill。 版本由 `config.yaml:skill_info.version` 统一管理。 ## 流程 ### 输入 输入为待渲染的 `.Rmd` 路径;可选输入包括项目根目录、输出文件路径、Pandoc 版本/下载选项和 `rmarkdown::render` 参数。渲染前需确认项目 `knit_root_dir`、R 和必要模板资源可用。 ### 执行步骤 #### 直接用法 - 在仓库根目录执行: - `python3 skills/knit-rmd-html/scripts/knit_rmd_html.py <input>.Rmd` - 输出默认写到 `<input>.Rmd` 同目录:`<input>.html` #### 常用参数 - 指定输出文件: - `python3 skills/knit-rmd-html/scripts/knit_rmd_html.py <input>.Rmd -o <output>.html` - 指定 pandoc 版本(默认 `3.8.3`): - `python3 skills/knit-rmd-html/scripts/knit_rmd_html.py <input>.Rmd --pandoc-version 3.8.3` - 不自动安装依赖(只做检测;缺什么就报错): - `python3 skills/knit-rmd-html/scripts/knit_rmd_html.py <input>.Rmd --no-install` - 静默渲染输出: - `python3 skills/knit-rmd-html/scripts/knit_rmd_html.py <input>.Rmd --quiet` #### 设计要点(为何这样做) - **不依赖 R 写脚本**:外层用 Python 做编排与环境自检;真正的 knit 仍由 `rmarkdown::render()` 执行。 - **自动补齐 pandoc**:若系统无 `pandoc`,自动下载安装到 `~/.local/pandoc/` 并将 `~/.local/bin` 放到子进程 `PATH` 前面。 - **兼容 Windows ZIP**:安全解压后递归寻找唯一的 `pandoc` / `pandoc.exe`,兼容根目录与 `bin/` 布局并拒绝歧义结果。 - **输出编码稳定**:Rscript 日志始终按 UTF-8 解码并保留真实退出码,不依赖 Windows 控制台 locale。 - **相对路径更稳**:用 `knit_root_dir=dirname(input)`,确保 Rmd 内 `source("xxx.R")` 等相对路径在 knit 时仍可用。 #### 工作原理 1. **环境检测**:检查 `pandoc` 和 `Rscript` 是否在 PATH 中 2. **...

Details

Author
huangwb8
Repository
huangwb8/skills
Created
8 months ago
Last Updated
today
Language
Python
License
MIT

Similar Skills

Semantically similar based on skill content — not just same category

Data & Documents Listed

online-doc-html

Export Markdown files to paste-friendly standalone HTML for online document editors. Use when the user wants to copy local Markdown content into an online document, reduce manual formatting work, preserve tables/code blocks/headings, convert SVG diagrams to PNG, embed images into HTML, or says "在线文档", "粘贴到在线文档", "Markdown 转 HTML", "图片复制不过去", "导出在线文档 HTML".

12 Updated 2 days ago
codingSamss
Data & Documents Listed

md-pdf-report

Convert Markdown research reports / fact-checks / scheme proposals into styled PDFs with native CJK (Chinese) font support. Markdown is the single source of truth; PDF is generated FROM the Markdown. Triggers on "做个 PDF 报告", "转成 PDF", "调研报告", "fact-check 报告", "方案 PDF", "scheme 报告", "给我 PDF", "PDF 版本", or any long-form analytical content that needs to be both editable (MD) and viewable/shareable (PDF).

0 Updated 1 months ago
0xcjl
Data & Documents Listed

render-html

Render an ARIS Markdown / JSON artifact (IDEA_REPORT, AUTO_REVIEW, KILL_ARGUMENT, PAPER_PLAN, research-wiki state, etc.) into a single-file HTML view designed for human reading. Academic template outputs are gated by a fresh cross-model Codex review for render fidelity + safety (the ARIS invariant). Use when the user says "渲染 HTML", "出一份 HTML 报告", "render html", "make this readable", "export to html", or wants a polished web-rendered view of a Markdown artifact. Markdown/JSON stays the canonical source; HTML is a generated, reviewed view.

6 Updated today
narsinghlaga124