Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,11 @@
"default": true,
"markdownDescription": "Enable automatic refresh of R Markdown preview on file update."
},
"r.rmarkdown.preview.zoom": {
"type": "number",
"default": 1,
"markdownDescription": "Controls the zoom of the R Markdown preview."
},
"r.rmarkdown.knit.useBackgroundProcess": {
"type": "boolean",
"default": true,
Expand Down
4 changes: 4 additions & 0 deletions src/rmarkdown/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,11 @@ class RMarkdownPreview extends vscode.Disposable {
const $ = cheerio.load(content);
this.htmlLightContent = $.html();

const zoom = config().get<number>('rmarkdown.preview.zoom', 1);

// make the output chunks a little lighter to stand out
let chunkCol = String(config().get('rmarkdown.chunkBackgroundColor'));

let outCol: string;
if (chunkCol) {
const colReg = /[0-9.]+/g;
Expand All @@ -106,6 +109,7 @@ class RMarkdownPreview extends vscode.Disposable {
const style =
`<style>
body {
zoom: ${zoom};
color: var(--vscode-editor-foreground);
background: var(--vscode-editor-background);
}
Expand Down