From 0f99400b0c1b5196b593776adf75ed0e67e39383 Mon Sep 17 00:00:00 2001 From: James J Balamuta Date: Fri, 7 Jun 2024 20:31:25 -0700 Subject: [PATCH] Modify editor font scale size defaults for HTML vs revealjs presentations (#209) * Document option * Add default variant for revealjs vs documents * Add release note --- _extensions/webr/webr.lua | 2 +- docs/qwebr-cell-options.qmd | 11 ++++++----- docs/qwebr-release-notes.qmd | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/_extensions/webr/webr.lua b/_extensions/webr/webr.lua index b735d79a..397c0a4e 100644 --- a/_extensions/webr/webr.lua +++ b/_extensions/webr/webr.lua @@ -91,7 +91,7 @@ local qwebRDefaultCellOptions = { ["fig-height"] = 5, ["out-width"] = "700px", ["out-height"] = "", - ["editor-font-scale"] = 1, + ["editor-font-scale"] = quarto.doc.is_format("revealjs") and "0.5" or "1", ["editor-max-height"] = "", ["editor-quick-suggestions"] = "false" } diff --git a/docs/qwebr-cell-options.qmd b/docs/qwebr-cell-options.qmd index 37be7eec..ca9a2ca0 100644 --- a/docs/qwebr-cell-options.qmd +++ b/docs/qwebr-cell-options.qmd @@ -52,11 +52,12 @@ For details regarding run options, please see [Hiding and Executing Code](qwebr- ### Monaco Editor Options -| Option | Default Value | Description | -|-----------|----------------|-----------------------------------------------------------------------------------------------------| -| `read-only` | `false` | Prevent code in `interactive` cells from being modified by disallowing code input. | -| `editor-max-height` | `0` | Set a threshold to prevent infinite growth of the editor window. | -| `editor-quick-suggestions` | `false` | Show a list of autocomplete variables and/or functions based on what was typed. | +| Option | Default Value | Description | +|----------------------------|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `read-only` | `false` | Prevent code in `interactive` cells from being modified by disallowing code input. | +| `editor-max-height` | `0` | Set a threshold to prevent infinite growth of the editor window. | +| `editor-quick-suggestions` | `false` | Show a list of autocomplete variables and/or functions based on what was typed. | +| `editor-font-scale` | `1` | Modify the size of code cell and output relative to the page font size. Values less than 1 shrink the text size and values greater than 1 increase the text size. | ## Attributes diff --git a/docs/qwebr-release-notes.qmd b/docs/qwebr-release-notes.qmd index 583af1dd..7f1d68e7 100644 --- a/docs/qwebr-release-notes.qmd +++ b/docs/qwebr-release-notes.qmd @@ -31,6 +31,8 @@ Features listed under the `-dev` version have not yet been solidified and may ch - Added `editor-max-height` cell option to limit growth of the editor window. ([#177](https://github.com/coatless/quarto-webr/issues/177), thanks [ute](https://github.com/ute)!) +- Added `editor-font-scale` cell option to scale the code cell size relative to the page font size. Default is `1` for HTML Documents, Books, and Websites and `0.5` for Revealjs Slides. ([#172](https://github.com/coatless/quarto-webr/issues/172) & [#209](https://github.com/coatless/quarto-webr/pull/209), thanks [ute](https://github.com/ute)!) + - Added `editor-quick-suggestions` cell option to enable autocomplete menu suggestions. ([#182](https://github.com/coatless/quarto-webr/issues/182), thanks [egenn](https://github.com/egenn)!) - Added the ability to have the monaco editor switch between Quarto's light and dark theme modes. ([#176](https://github.com/coatless/quarto-webr/issues/176))