REditorSupport / REditorSupport/vscode-R

Preivew button use smart knit

Open
#1,345 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

Is your feature request related to a problem? Please describe.
I use following yaml header in my Rmd file:

---
title: "vignette"
output: 
  bookdown::html_vignette2:
    fig_caption: true
    number_sections: true
    global_numbering: true
vignette: >
  %\VignetteIndexEntry{vignette}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
knit: (function(input, ...) {
    rmarkdown::render(
      input,
      knit_root_dir = dirname(input),
      intermediates_dir = dirname(input)
    )
  })
---

image

when we use a custom knit function in the yaml header like above, the knit button will work well but the preview will stop with error since I set intermediates_dir in the yaml header knit function
image

Describe the solution you'd like
Preview buttom do the same of smart knit button

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the VS Code Preview and Smart Knit command entry points and compare how each invokes the R Markdown knit function, especially its handling of intermediates_dir. Done means Preview follows the Smart Knit behavior for this custom YAML knit function without the reported error.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.