diff --git a/DESCRIPTION b/DESCRIPTION index 4182349a5d..33174bc10b 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,6 +2,7 @@ Type: quarto-web Description: Quarto Web project for quarto.org Depends: broom, + colorspace, dplyr, DT, dygraphs, diff --git a/_freeze/docs/output-formats/examples/gt-temps/execute-results/typ.json b/_freeze/docs/output-formats/examples/gt-temps/execute-results/typ.json index 782c9b089c..acbb898600 100644 --- a/_freeze/docs/output-formats/examples/gt-temps/execute-results/typ.json +++ b/_freeze/docs/output-formats/examples/gt-temps/execute-results/typ.json @@ -2,7 +2,7 @@ "hash": "da0944f7bc7c45f9aa81e623e15b4a45", "result": { "engine": "knitr", - "markdown": "---\ntitle: \"gt - temperatures\"\nformat:\n typst: default\nbibliography: [] # suppress ../../../references.bib\nreferences:\n - type: website\n id: gt-cookbook\n url: https://themockup.blog/static/resources/gt-cookbook.html#multiple-columns\n---\n\n```{=typst}\n#set page(\n numbering: none\n)\n```\n\n::: {.cell}\n::: {.cell-output-display}\n\n```{=html}\n
\n\n\n \n \n \n \n \n \n \n \n \n\n\n \n\n\n \n\n\n \n\n\n \n\n\n \n \n \n
yearJanJun
192040.658.5
192144.258.7
192237.557.8
192341.852.7
192439.357.7
\n
\n```\n\n:::\n:::", + "markdown": "---\ntitle: \"gt - temperatures\"\nformat:\n typst: default\nbibliography: [] # suppress ../../../references.bib\nreferences:\n - type: website\n id: gt-cookbook\n url: https://themockup.blog/static/resources/gt-cookbook.html#multiple-columns\n---\n\n```{=typst}\n#set page(\n numbering: none\n)\n```\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(gt)\ntemps <- data.frame(\n year = c(1920:1924),\n Jan = c(40.6, 44.2, 37.5, 41.8, 39.3), \n Jun = c(58.5, 58.7, 57.8, 52.7, 57.7)\n)\ntemps |>\n gt() |> \n data_color(\n columns = c(-year),\n fn = scales::col_numeric(\n colorspace::diverge_hcl(n = 9,\n palette = \"Green-Orange\"),\n domain = c(35, 62))\n )\n```\n\n::: {.cell-output-display}\n\n```{=html}\n
\n\n\n \n \n \n \n \n \n \n \n \n\n\n \n\n\n \n\n\n \n\n\n \n\n\n \n \n
yearJanJun
192040.658.5
192144.258.7
192237.557.8
192341.852.7
192439.357.7
\n
\n```\n\n:::\n:::\n", "supporting": [], "filters": [ "rmarkdown/pagebreak.lua" diff --git a/_freeze/docs/output-formats/examples/pandas-temps/execute-results/typ.json b/_freeze/docs/output-formats/examples/pandas-temps/execute-results/typ.json index e7e8f97382..08099145c7 100644 --- a/_freeze/docs/output-formats/examples/pandas-temps/execute-results/typ.json +++ b/_freeze/docs/output-formats/examples/pandas-temps/execute-results/typ.json @@ -2,10 +2,11 @@ "hash": "2d43c217d618d559ca4b321734cacf91", "result": { "engine": "jupyter", - "markdown": "---\ntitle: \"gt - temperatures\"\nformat:\n typst: default\nbibliography: [] # suppress ../../../references.bib\nreferences:\n - type: website\n id: gt-cookbook\n url: https://themockup.blog/static/resources/gt-cookbook.html#multiple-columns\n---\n\n```{=typst}\n#set page(\n numbering: none\n)\n```\n\n::: {.cell execution_count=1}\n\n::: {.cell-output .cell-output-display execution_count=1}\n```{=html}\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 JanJun
year  
192040.60000058.500000
192144.20000058.700000
192237.50000057.800000
192341.80000052.700000
192439.30000057.700000
\n```\n:::\n:::\n\n\n", + "markdown": "---\ntitle: \"gt - temperatures\"\nformat:\n typst: default\nbibliography: [] # suppress ../../../references.bib\nreferences:\n - type: website\n id: gt-cookbook\n url: https://themockup.blog/static/resources/gt-cookbook.html#multiple-columns\n---\n\n```{=typst}\n#set page(\n numbering: none\n)\n```\n\n::: {.cell execution_count=1}\n``` {.python .cell-code}\nimport pandas as pd\nimport numpy as np\n\ntemps = pd.DataFrame({\n 'year': [*range(1920, 1925)],\n 'Jan': [40.6, 44.2, 37.5, 41.8, 39.3], \n 'Jun': [58.5, 58.7, 57.8, 52.7, 57.7]\n}).set_index('year')\n\ndef make_pretty(styler):\n styler.background_gradient(axis=None,\n vmin=31, vmax=66, cmap=\"RdYlGn_r\")\n return styler\n\ntemps.style.pipe(make_pretty)\n```\n\n::: {.cell-output .cell-output-display execution_count=1}\n```{=html}\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 JanJun
year  
192040.60000058.500000
192144.20000058.700000
192237.50000057.800000
192341.80000052.700000
192439.30000057.700000
\n```\n:::\n:::\n\n\n", "supporting": [ "pandas-temps_files" ], - "filters": [] + "filters": [], + "includes": {} } } \ No newline at end of file diff --git a/_freeze/docs/output-formats/html-code/execute-results/html.json b/_freeze/docs/output-formats/html-code/execute-results/html.json index d962a05963..315f71a7a3 100644 --- a/_freeze/docs/output-formats/html-code/execute-results/html.json +++ b/_freeze/docs/output-formats/html-code/execute-results/html.json @@ -1,8 +1,8 @@ { - "hash": "d2ff124445738133aee2de787962d845", + "hash": "f2f8bec0721206758ee53e7f669cffb7", "result": { "engine": "knitr", - "markdown": "---\ntitle: \"HTML Code Blocks\"\nformat: \n html:\n code-tools: true\nexecute:\n warning: false\n---\n\n## Overview\n\nThere are wide variety of options available to customize the display of source code within HTML documents, including:\n\n1. Hiding some or all code that was executed by [Knitr](https://yihui.name/knitr) or [Jupyter](https://jupyter.org).\n2. Code folding for executed code (hidden by default and expandable by readers).\n3. Handling code that overflows the available horizontal display space.\n4. View the source code of the markdown file used to generate the document.\n5. Syntax highlighting themes and other options to control the appearance of code.\n6. Copy to clipboard button for code blocks.\n7. Generating hyperlinks to online documentation for functions used within code blocks via the [downlit](https://downlit.r-lib.org/) package (note that this option currently only works when using the Knitr engine).\n\nDetails on using all of these options are provided below.\n\n## Hiding Code\n\nFor many documents you may want to hide all of the executable source code used to produce dynamic outputs. You can do this by specifying `echo: false` in the document `execute` options. For example:\n\n``` yaml\n---\ntitle: \"My Document\"\nexecute:\n echo: false\njupyter: python3\n---\n```\n\nNote that we can override this option on a per code-block basis. For example:\n\n```{{python}}\n#| echo: true\n\nimport matplotlib.pyplot as plt\nplt.plot([1,2,3,4])\nplt.show()\n```\n\nCode block options are included in a special comment at the top of the block (lines at the top prefaced with `#|` are considered options).\n\n## Folding Code\n\nUse the `code-fold` option to include code but have it hidden by default using the HTML `
` tag. For example, click the **Code** button to see the code that produced this plot.\n\n\n::: {.cell}\n\n```{.r .cell-code code-fold=\"true\"}\nlibrary(ggplot2)\ndat <- data.frame(cond = rep(c(\"A\", \"B\"), each=10),\n xvar = 1:20 + rnorm(20,sd=3),\n yvar = 1:20 + rnorm(20,sd=3))\n\nggplot(dat, aes(x=xvar, y=yvar)) +\n geom_point(shape=1) + \n geom_smooth() \n```\n\n::: {.cell-output-display}\n![](html-code_files/figure-html/unnamed-chunk-1-1.png){width=672}\n:::\n:::\n\n\nHere we specify both `code-fold: true` as well as custom summary text (the default is just \"Code\" as shown above):\n\n``` yaml\nformat:\n html:\n code-fold: true\n code-summary: \"Show the code\"\n```\n\nValid values for `code-fold` include:\n\n| Value | Behavior |\n|---------|------------------------------|\n| `false` | No folding (default) |\n| `true` | Fold code (initially hidden) |\n| `show` | Fold code (initially shown) |\n\nUse the `code-fold` and `code-summary` chunk attributes to control this on a chunk-by-chunk basis:\n\n```{{r}}\n#| code-fold: true\n#| code-summary: \"Show the code\"\n```\n\n## Code Overflow\n\nIn some cases the width of source code will overflow the available horizontal display space. By default, this will result in a horizontal scroll bar for the code block. However if you prefer not to have scrollbars you can have the longer lines wrap instead.\n\nTo set the global default behavior use the `code-overflow` option. For example:\n\n``` yaml\nformat:\n html:\n code-overflow: wrap\n```\n\nValid values for `code-overflow` are:\n\n| Option | Description |\n|------------------|------------------------------------------------------|\n| `scroll` | Scroll code blocks that exceed available width (default, corresponds to `white-space: pre`). |\n| `wrap` | Wrap lines of code that exceed available width (corresponds to `white-space: pre-wrap`). |\n\nYou can also override the global default on a per-code-block basis. For computational cells you do this with the `code-overflow` cell option:\n\n```{{python}}\n#| code-overflow: wrap\n\n# very long line of code....\n```\n\nFor a static code block, add the `.code-overflow-scroll` or `.code-overflow-wrap` CSS class:\n\n```` python\n```{.python .code-overflow-wrap}\n# very long line of code....\n```\n````\n\nNote that irrespective of these options, code will always wrap within printed HTML output (as it would otherwise be clipped off the edge of the page).\n\n## Code Tools\n\nYou can include a **Code** menu in the header of your document that provides various tools for readers to interact with the source code. Specify `code-tools: true` to activate these tools:\n\n``` yaml\nformat:\n html:\n code-fold: true\n code-tools: true\n```\n\nIf you have a document that includes folded code blocks then the **Code** menu will present options to show and hide the folded code as well as view the full source code of the document:\n\n![](images/code-tools-01.png){.border fig-alt=\"A screen shot of the header of a rendered Quarto document showing the result of setting both the code-fold and code-tools option to true. There is a drop-down menu labeled 'Code' to the right of the page title with a triangle pointing down. The menu is open and there are three options listed vertically beneath it: 'Hide All Code,' 'Show All Code,' and 'View Source.'\"}\n\nThis document specifies `code-tools: true` in its options so you should see the **Code** menu above next to the main header.\n\nYou can control which of these options are made available as well as the \"Code\" caption text using sub-options of `code-tools`. For example, here we specify that we want only \"View Source\" (no toggling of code visibility) and no caption on the code menu:\n\n``` yaml\nformat:\n html: \n code-tools:\n source: true\n toggle: false\n caption: none\n```\n\nBy default, the source code is embedded in the document and shown in a popup window like this:\n\n![](images/code-tools-source.png){fig-alt=\"A screenshot of this webpage with a pop-up window labeled 'Source Code' over it. This 'Source Code' window contains the raw markdown and R code used to write this page. There is an 'X' on the upper right corner of the 'Source Code' pop up to close it.\"}\n\nYou can alternatively specify a URL for the value of `source`:\n\n``` yaml\nformat:\n html: \n code-tools:\n source: https://github.com/quarto-dev/quarto-web/blob/main/index.md\n```\n\nIf you are within a project and have specified a `repo-url` option then you can just use `repo` and the correct link to your source file will be generated:\n\n``` yaml\nformat:\n html: \n code-tools:\n source: repo\n```\n\nNote that the `code-tools` option is not available when you disable the standard HTML theme (e.g. if you specify the `theme: none` option).\n\n## Appearance\n\nBy default code blocks are rendered with a left border whose color is derived from the current theme. You can customize code chunk appearance with some simple options that control the background color and left border. Options can either be booleans to enable or disable the treatment or can be legal CSS color strings (or they could even be SASS variable names!).\n\nHere is the default appearance for code blocks (`code-block-bg: true`):\n\n![](images/code-bg.png){fig-alt=\"A block of code with a gray background.\"}\n\nYou can instead use a left border treatment using the `code-block-border-left` option:\n\n``` yaml\ncode-block-border-left: true\n```\n\n![](images/code-default.png){fig-alt=\"A block of code with a gray vertical stripe running along its left border. This code block has no background.\"}\n\nYou can combine a background and border treatment as well as customize the left border color:\n\n``` yaml\ncode-block-bg: true\ncode-block-border-left: \"#31BAE9\"\n```\n\n![](images/code-custom.png){fig-alt=\"A block of code with a gray background and a blue vertical stripe running along its left border.\"}\n\n## Code Filename {#code-filename}\n\nUse the `filename` attribute on code blocks If you are documenting the contents of a file and want to be especially clear about the name of the file the code is associated with.\n\nFor example, the following code:\n\n```` markdown\n```{.python filename=\"matplotlib.py\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n````\n\nResults in this HTML output:\n\n```{.python filename=\"matplotlib.py\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n\nNon-HTML formats will still have the filename, but it will simply be shown in bold above the code block.\n\n## Highlighting\n\nPandoc will automatically highlight syntax in [fenced code blocks](https://pandoc.org/MANUAL.html#fenced-code-blocks) that are marked with a language name. For example:\n\n ```python\n 1 + 1\n ```\n\nPandoc can provide syntax highlighting for over 140 different languages (see the output of `quarto pandoc --list-highlight-languages` for a list of all of them). If you want to provide the appearance of a highlighted code block for a language not supported, just use `default` as the language name.\n\nYou can specify the code highlighting style using `highlight-style` and specifying one of the supported themes. These themes are \"adaptive\", which means they will automatically switch between a dark and light mode based upon the theme of the website. These are designed to work well with sites that include a dark and light mode.\n\n- a11y\n- arrow\n- atom-one\n- ayu\n- breeze\n- github\n- gruvbox\n\nAll of the standard Pandoc themes are also available:\n\n- pygments\n- tango\n- espresso\n- zenburn\n- kate\n- monochrome\n- breezedark\n- haddock\n\nAs well as an additional set of extended themes, including:\n\n- dracula\n- monokai\n- nord\n- oblivion\n- printing\n- radical\n- solarized\n- vim-dark\n\nThe `highlight-style` option determines which theme is used. For example:\n\n``` yaml\nhighlight-style: github\n```\n\nHighlighting themes can provide either a single highlighting definition or two definitions, one optimized for a light colored background and another optimized for a dark color background. When available, Quarto will automatically select the appropriate style based upon the code chunk background color's darkness. Users may always opt to specify the full name (e.g. `atom-one-dark`) to by pass this automatic behavior.\n\nBy default, code is highlighted using the `arrow` theme, which is optimized for accessibility. We've additionally introduced the `arrow-dark` theme which is designed to provide accessible highlighting against dark backgrounds.\n\nExamples of the light and dark themes:\n\n#### Arrow (light)\n\n![](images/arrow.png){fig.alt=\"A block of code showcasing the Arrow (light) theme.\"}\n\n#### Arrow (dark)\n\n![](images/arrow-dark.png){fig.alt=\"A block of code showcasing the Arrow (dark) theme.\"}\n\n#### Ayu (light)\n\n![](images/ayu.png){fig.alt=\"A block of code showcasing the Ayu (light) theme.\"}\n\n#### Ayu (dark)\n\n![](images/ayu-dark.png){.preview-image fig.alt=\"A block of code showcasing the Ayu (dark) theme.\"}\n\n### Custom Highlighting\n\nIn addition to the built in themes available for syntax highlighting, you can also specify your own syntax highlighting by providing the path to a valid theme file (which is based upon the KDE XML syntax highlighting descriptions). Highlighting is implemented using [skylighting](https://github.com/jgm/skylighting).\n\nFor example:\n\n``` yaml\n---\nhighlight-style: custom.theme\n---\n```\n\nIn addition, if you'd like to provide adaptive themes, you may also pass both a light and dark theme file:\n\n``` yaml\n---\nhighlight-style:\n light: custom-light.theme\n dark: custom-dark.theme\n---\n```\n\nNote that as with adaptive text higlighting themes, when you provide a dark and light `highlight-style`, background colors specified in the themes will be ignored in favor of the overall theme specified background colors.\n\n## Code Annotation\n\nYou can add annotations to lines of code in code blocks and executable code cells. See [Code Annotation](/docs/authoring/code-annotation.qmd) for full details.\n\n\n## Line Numbers {#line-numbers}\n\nIf you want to display line numbers alongside the code block, add the `code-line-numbers` option. For example:\n\n``` yaml\nformat:\n html:\n code-line-numbers: true\n```\n\nHere's how a code block with line numbers would display:\n\n``` {.python code-line-numbers=\"true\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n\nYou can also enable line numbers for an individual code block using the `code-line-numbers` attribute. For example:\n\n```` python\n``` {.python code-line-numbers=\"true\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n````\n\n## Executable Blocks\n\nThe documentation on [computations](/docs/get-started/computations/index.qmd) covers how to include executable code blocks (code which is actually executed, with its output being included in the rendered document). We won't additionally cover that here, but we will talk about how to include code blocks that demonstrate executable syntax (e.g. for writing a tutorial).\n\n\n\n\nOften you'll want to include a fenced code block purely as documentation (not executable). You can do this by using two curly braces around the language (e.g. `python`, `r`, etc.) rather than one. For example:\n\n```{{{python}}}\n1 + 1\n```\n\nWill be output into the document as:\n\n```{{python}}\n1 + 1\n```\n\nIf you want to show an example with multiple code blocks and other markdown, just enclose the entire example in 4 backticks (e.g. ````` ```` `````) and use the two curly brace syntax for code blocks within. For example:\n\n ````\n ---\n title: \"My document\"\n ---\n\n Some markdown content.\n\n ```{{{python}}}\n 1 + 1\n ```\n\n Some additional markdown content.\n\n ````\n\n\n## Copy Button\n\nHover over the code block below and you will see a copy icon in the top-right corner:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(dygraphs)\ndygraph(nhtemp, main = \"New Haven Temperatures\") %>% \n dyRangeSelector(dateWindow = c(\"1920-01-01\", \"1960-01-01\"))\n```\n:::\n\n\nThis behavior is enabled by default but you configure it using the `code-copy` option:\n\n``` yaml\nformat:\n html:\n code-copy: false\n```\n\nValid values for `code-copy` include:\n\n| | |\n|---------|--------------------------------|\n| `hover` | Show button on hover (default) |\n| `true` | Always show code copy button |\n| `false` | Never show code copy button |\n\n## Code Linking\n\nThe `code-link` option enables hyper-linking of functions within code blocks to their online documentation:\n\n``` yaml\nformat:\n html:\n code-link: true\n```\n\nCode linking is currently implemented only for the knitr engine (via the [downlit](https://downlit.r-lib.org) package).\nA limitation of downlit currently prevents code linking if `code-line-numbers` and/or `code-annotations` are also `true`.\n", + "markdown": "---\ntitle: \"HTML Code Blocks\"\nformat: \n html:\n code-tools: true\nexecute:\n warning: false\n---\n\n## Overview\n\nThere are wide variety of options available to customize the display of source code within HTML documents, including:\n\n1. Hiding some or all code that was executed by [Knitr](https://yihui.name/knitr) or [Jupyter](https://jupyter.org).\n2. Code folding for executed code (hidden by default and expandable by readers).\n3. Handling code that overflows the available horizontal display space.\n4. View the source code of the markdown file used to generate the document.\n5. Syntax highlighting themes and other options to control the appearance of code.\n6. Copy to clipboard button for code blocks.\n7. Generating hyperlinks to online documentation for functions used within code blocks via the [downlit](https://downlit.r-lib.org/) package (note that this option currently only works when using the Knitr engine).\n\nDetails on using all of these options are provided below.\n\n## Hiding Code\n\nFor many documents you may want to hide all of the executable source code used to produce dynamic outputs. You can do this by specifying `echo: false` in the document `execute` options. For example:\n\n``` yaml\n---\ntitle: \"My Document\"\nexecute:\n echo: false\njupyter: python3\n---\n```\n\nNote that we can override this option on a per code-block basis. For example:\n\n```{{python}}\n#| echo: true\n\nimport matplotlib.pyplot as plt\nplt.plot([1,2,3,4])\nplt.show()\n```\n\nCode block options are included in a special comment at the top of the block (lines at the top prefaced with `#|` are considered options).\n\n## Folding Code\n\nUse the `code-fold` option to include code but have it hidden by default using the HTML `
` tag. For example, click the **Code** button to see the code that produced this plot.\n\n\n::: {.cell}\n\n```{.r .cell-code code-fold=\"true\"}\nlibrary(ggplot2)\ndat <- data.frame(cond = rep(c(\"A\", \"B\"), each=10),\n xvar = 1:20 + rnorm(20,sd=3),\n yvar = 1:20 + rnorm(20,sd=3))\n\nggplot(dat, aes(x=xvar, y=yvar)) +\n geom_point(shape=1) + \n geom_smooth() \n```\n\n::: {.cell-output-display}\n![](html-code_files/figure-html/unnamed-chunk-1-1.png){width=672}\n:::\n:::\n\n\nHere we specify both `code-fold: true` as well as custom summary text (the default is just \"Code\" as shown above):\n\n``` yaml\nformat:\n html:\n code-fold: true\n code-summary: \"Show the code\"\n```\n\nValid values for `code-fold` include:\n\n| Value | Behavior |\n|---------|------------------------------|\n| `false` | No folding (default) |\n| `true` | Fold code (initially hidden) |\n| `show` | Fold code (initially shown) |\n\nUse the `code-fold` and `code-summary` chunk attributes to control this on a chunk-by-chunk basis:\n\n```{{r}}\n#| code-fold: true\n#| code-summary: \"Show the code\"\n```\n\n## Code Overflow\n\nIn some cases the width of source code will overflow the available horizontal display space. By default, this will result in a horizontal scroll bar for the code block. However if you prefer not to have scrollbars you can have the longer lines wrap instead.\n\nTo set the global default behavior use the `code-overflow` option. For example:\n\n``` yaml\nformat:\n html:\n code-overflow: wrap\n```\n\nValid values for `code-overflow` are:\n\n| Option | Description |\n|------------------|------------------------------------------------------|\n| `scroll` | Scroll code blocks that exceed available width (default, corresponds to `white-space: pre`). |\n| `wrap` | Wrap lines of code that exceed available width (corresponds to `white-space: pre-wrap`). |\n\nYou can also override the global default on a per-code-block basis. For computational cells you do this with the `code-overflow` cell option:\n\n```{{python}}\n#| code-overflow: wrap\n\n# very long line of code....\n```\n\nFor a static code block, add the `.code-overflow-scroll` or `.code-overflow-wrap` CSS class:\n\n```` python\n```{.python .code-overflow-wrap}\n# very long line of code....\n```\n````\n\nNote that irrespective of these options, code will always wrap within printed HTML output (as it would otherwise be clipped off the edge of the page).\n\n## Code Tools\n\nYou can include a **Code** menu in the header of your document that provides various tools for readers to interact with the source code. Specify `code-tools: true` to activate these tools:\n\n``` yaml\nformat:\n html:\n code-fold: true\n code-tools: true\n```\n\nIf you have a document that includes folded code blocks then the **Code** menu will present options to show and hide the folded code as well as view the full source code of the document:\n\n![](images/code-tools-01.png){.border fig-alt=\"A screen shot of the header of a rendered Quarto document showing the result of setting both the code-fold and code-tools option to true. There is a drop-down menu labeled 'Code' to the right of the page title with a triangle pointing down. The menu is open and there are three options listed vertically beneath it: 'Hide All Code,' 'Show All Code,' and 'View Source.'\"}\n\nThis document specifies `code-tools: true` in its options so you should see the **Code** menu above next to the main header.\n\nYou can control which of these options are made available as well as the \"Code\" caption text using sub-options of `code-tools`. For example, here we specify that we want only \"View Source\" (no toggling of code visibility) and no caption on the code menu:\n\n``` yaml\nformat:\n html: \n code-tools:\n source: true\n toggle: false\n caption: none\n```\n\nBy default, the source code is embedded in the document and shown in a popup window like this:\n\n![](images/code-tools-source.png){fig-alt=\"A screenshot of this webpage with a pop-up window labeled 'Source Code' over it. This 'Source Code' window contains the raw markdown and R code used to write this page. There is an 'X' on the upper right corner of the 'Source Code' pop up to close it.\"}\n\nYou can alternatively specify a URL for the value of `source`:\n\n``` yaml\nformat:\n html: \n code-tools:\n source: https://github.com/quarto-dev/quarto-web/blob/main/index.md\n```\n\nIf you are within a project and have specified a `repo-url` option then you can just use `repo` and the correct link to your source file will be generated:\n\n``` yaml\nformat:\n html: \n code-tools:\n source: repo\n```\n\nNote that the `code-tools` option is not available when you disable the standard HTML theme (e.g. if you specify the `theme: none` option).\n\n## Appearance\n\nBy default code blocks are rendered with a left border whose color is derived from the current theme. You can customize code chunk appearance with some simple options that control the background color and left border. Options can either be booleans to enable or disable the treatment or can be legal CSS color strings (or they could even be SASS variable names!).\n\nHere is the default appearance for code blocks (`code-block-bg: true`):\n\n![](images/code-bg.png){fig-alt=\"A block of code with a gray background.\"}\n\nYou can instead use a left border treatment using the `code-block-border-left` option:\n\n``` yaml\ncode-block-border-left: true\n```\n\n![](images/code-default.png){fig-alt=\"A block of code with a gray vertical stripe running along its left border. This code block has no background.\"}\n\nYou can combine a background and border treatment as well as customize the left border color:\n\n``` yaml\ncode-block-bg: true\ncode-block-border-left: \"#31BAE9\"\n```\n\n![](images/code-custom.png){fig-alt=\"A block of code with a gray background and a blue vertical stripe running along its left border.\"}\n\n## Code Filename {#code-filename}\n\nUse the `filename` attribute on code blocks If you are documenting the contents of a file and want to be especially clear about the name of the file the code is associated with.\n\nFor example, the following code:\n\n```` markdown\n```{.python filename=\"matplotlib.py\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n````\n\nResults in this HTML output:\n\n```{.python filename=\"matplotlib.py\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n\nNon-HTML formats will still have the filename, but it will simply be shown in bold above the code block.\n\n## Highlighting\n\nPandoc will automatically highlight syntax in [fenced code blocks](https://pandoc.org/MANUAL.html#fenced-code-blocks) that are marked with a language name. For example:\n\n ```python\n 1 + 1\n ```\n\nPandoc can provide syntax highlighting for over 140 different languages (see the output of `quarto pandoc --list-highlight-languages` for a list of all of them). If you want to provide the appearance of a highlighted code block for a language not supported, just use `default` as the language name.\n\nYou can specify the code highlighting style using `syntax-highlighting` and specifying one of the supported themes. These themes are \"adaptive\", which means they will automatically switch between a dark and light mode based upon the theme of the website. These are designed to work well with sites that include a dark and light mode.\n\n- a11y\n- arrow\n- atom-one\n- ayu\n- breeze\n- github\n- gruvbox\n\nAll of the standard Pandoc themes are also available:\n\n- pygments\n- tango\n- espresso\n- zenburn\n- kate\n- monochrome\n- breezedark\n- haddock\n\nAs well as an additional set of extended themes, including:\n\n- dracula\n- monokai\n- nord\n- oblivion\n- printing\n- radical\n- solarized\n- vim-dark\n\nThe `syntax-highlighting` option determines which theme is used. For example:\n\n``` yaml\nsyntax-highlighting: github\n```\n\nHighlighting themes can provide either a single highlighting definition or two definitions, one optimized for a light colored background and another optimized for a dark color background. When available, Quarto will automatically select the appropriate style based upon the code chunk background color's darkness. Users may always opt to specify the full name (e.g. `atom-one-dark`) to by pass this automatic behavior.\n\nBy default, code is highlighted using the `arrow` theme, which is optimized for accessibility. We've additionally introduced the `arrow-dark` theme which is designed to provide accessible highlighting against dark backgrounds.\n\nExamples of the light and dark themes:\n\n#### Arrow (light)\n\n![](images/arrow.png){fig-alt=\"A block of code showcasing the Arrow (light) theme.\"}\n\n#### Arrow (dark)\n\n![](images/arrow-dark.png){fig-alt=\"A block of code showcasing the Arrow (dark) theme.\"}\n\n#### Ayu (light)\n\n![](images/ayu.png){fig-alt=\"A block of code showcasing the Ayu (light) theme.\"}\n\n#### Ayu (dark)\n\n![](images/ayu-dark.png){.preview-image fig-alt=\"A block of code showcasing the Ayu (dark) theme.\"}\n\n### Custom Highlighting\n\nIn addition to the built in themes available for syntax highlighting, you can also specify your own syntax highlighting by providing the path to a valid theme file (which is based upon the KDE XML syntax highlighting descriptions). Highlighting is implemented using [skylighting](https://github.com/jgm/skylighting).\n\nFor example:\n\n``` yaml\n---\nsyntax-highlighting: custom.theme\n---\n```\n\nIn addition, if you'd like to provide adaptive themes, you may also pass both a light and dark theme file:\n\n``` yaml\n---\nsyntax-highlighting:\n light: custom-light.theme\n dark: custom-dark.theme\n---\n```\n\nNote that as with adaptive text higlighting themes, when you provide a dark and light `syntax-highlighting`, background colors specified in the themes will be ignored in favor of the overall theme specified background colors.\n\n## Code Annotation\n\nYou can add annotations to lines of code in code blocks and executable code cells. See [Code Annotation](/docs/authoring/code-annotation.qmd) for full details.\n\n\n## Line Numbers {#line-numbers}\n\nIf you want to display line numbers alongside the code block, add the `code-line-numbers` option. For example:\n\n``` yaml\nformat:\n html:\n code-line-numbers: true\n```\n\nHere's how a code block with line numbers would display:\n\n``` {.python code-line-numbers=\"true\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n\nYou can also enable line numbers for an individual code block using the `code-line-numbers` attribute. For example:\n\n```` python\n``` {.python code-line-numbers=\"true\"}\nimport matplotlib.pyplot as plt\nplt.plot([1,23,2,4])\nplt.show()\n```\n````\n\n## Executable Blocks\n\nThe documentation on [computations](/docs/get-started/computations/index.qmd) covers how to include executable code blocks (code which is actually executed, with its output being included in the rendered document). We won't additionally cover that here, but we will talk about how to include code blocks that demonstrate executable syntax (e.g. for writing a tutorial).\n\n\n\n\nOften you'll want to include a fenced code block purely as documentation (not executable). You can do this by using two curly braces around the language (e.g. `python`, `r`, etc.) rather than one. For example:\n\n```{{{python}}}\n1 + 1\n```\n\nWill be output into the document as:\n\n```{{python}}\n1 + 1\n```\n\nIf you want to show an example with multiple code blocks and other markdown, just enclose the entire example in 4 backticks (e.g. ````` ```` `````) and use the two curly brace syntax for code blocks within. For example:\n\n ````\n ---\n title: \"My document\"\n ---\n\n Some markdown content.\n\n ```{{{python}}}\n 1 + 1\n ```\n\n Some additional markdown content.\n\n ````\n\n\n## Copy Button\n\nHover over the code block below and you will see a copy icon in the top-right corner:\n\n\n::: {.cell}\n\n```{.r .cell-code}\nlibrary(dygraphs)\ndygraph(nhtemp, main = \"New Haven Temperatures\") %>% \n dyRangeSelector(dateWindow = c(\"1920-01-01\", \"1960-01-01\"))\n```\n:::\n\n\nThis behavior is enabled by default but you configure it using the `code-copy` option:\n\n``` yaml\nformat:\n html:\n code-copy: false\n```\n\nValid values for `code-copy` include:\n\n| | |\n|---------|--------------------------------|\n| `hover` | Show button on hover (default) |\n| `true` | Always show code copy button |\n| `false` | Never show code copy button |\n\n## Code Linking\n\nThe `code-link` option enables hyper-linking of functions within code blocks to their online documentation:\n\n``` yaml\nformat:\n html:\n code-link: true\n```\n\nCode linking is currently implemented only for the knitr engine (via the [downlit](https://downlit.r-lib.org) package).\nA limitation of downlit currently prevents code linking if `code-line-numbers` and/or `code-annotations` are also `true`.\n", "supporting": [ "html-code_files" ], diff --git a/_freeze/docs/output-formats/html-code/figure-html/unnamed-chunk-1-1.png b/_freeze/docs/output-formats/html-code/figure-html/unnamed-chunk-1-1.png index 6a0b8f8096..0f9d6cf182 100644 Binary files a/_freeze/docs/output-formats/html-code/figure-html/unnamed-chunk-1-1.png and b/_freeze/docs/output-formats/html-code/figure-html/unnamed-chunk-1-1.png differ diff --git a/docs/books/book-output.qmd b/docs/books/book-output.qmd index d17e86d4b5..b086fe6f03 100644 --- a/docs/books/book-output.qmd +++ b/docs/books/book-output.qmd @@ -13,19 +13,19 @@ If you want to specify rendering options (including format-specific options), yo Here's an example configuration: ``` yaml -highlight-style: pygments +syntax-highlighting: pygments format: html: theme: cosmo code-copy: true pdf: default - + bibliography: references.bib csl: citestyle.csl ``` -Note that in the above configuration the `highlight-style` option applies to all formats whereas the `html` options apply to only HTML output. The bibliography related options naturally also apply to all formats. +Note that in the above configuration the `syntax-highlighting` option applies to all formats whereas the `html` options apply to only HTML output. The bibliography related options naturally also apply to all formats. ## Reader Tools diff --git a/docs/get-started/authoring/_authoring-complete.qmd b/docs/get-started/authoring/_authoring-complete.qmd index 49fe1102aa..2cdd7b3a8b 100644 --- a/docs/get-started/authoring/_authoring-complete.qmd +++ b/docs/get-started/authoring/_authoring-complete.qmd @@ -3,7 +3,7 @@ title: "Housing Prices" author: "Mine Çetinkaya-Rundel" toc: true number-sections: true -highlight-style: pygments +syntax-highlighting: pygments format: html: code-fold: true diff --git a/docs/get-started/authoring/_text-editor.md b/docs/get-started/authoring/_text-editor.md index e13497fe76..e56e5bfafb 100644 --- a/docs/get-started/authoring/_text-editor.md +++ b/docs/get-started/authoring/_text-editor.md @@ -70,7 +70,7 @@ title: "Quarto Document" author: "Norah Jones" toc: true number-sections: true -highlight-style: pygments +syntax-highlighting: pygments format: pdf: geometry: @@ -95,7 +95,7 @@ The next three lines are document format options that *apply to all formats*. wh ``` yaml toc: true number-sections: true -highlight-style: pygments +syntax-highlighting: pygments ``` Next, we have the `format` option, where we provide format-specific options. diff --git a/docs/get-started/authoring/jupyter.qmd b/docs/get-started/authoring/jupyter.qmd index d64f88e132..d78a898b17 100644 --- a/docs/get-started/authoring/jupyter.qmd +++ b/docs/get-started/authoring/jupyter.qmd @@ -69,7 +69,7 @@ title: "Quarto Document" author: "Norah Jones" toc: true number-sections: true -highlight-style: pygments +syntax-highlighting: pygments format: html: code-fold: true @@ -100,7 +100,7 @@ which is why they are specified at the root level. ``` yaml toc: true number-sections: true -highlight-style: pygments +syntax-highlighting: pygments ``` Next, we have the `format` option, where we provide format-specific options. diff --git a/docs/get-started/authoring/rstudio.qmd b/docs/get-started/authoring/rstudio.qmd index 148a36352e..ca128bf138 100644 --- a/docs/get-started/authoring/rstudio.qmd +++ b/docs/get-started/authoring/rstudio.qmd @@ -105,7 +105,7 @@ Let's add the `html` and `docx` formats to our document and modify some options --- title: "Housing Prices" author: "Mine Çetinkaya-Rundel" -highlight-style: pygments +syntax-highlighting: pygments format: html: code-fold: true @@ -133,7 +133,7 @@ The next line is a document format option that *applies to all formats*, which i ``` yaml --- -highlight-style: pygments +syntax-highlighting: pygments --- ``` @@ -199,7 +199,7 @@ title: "Housing Prices" author: "Mine Çetinkaya-Rundel" toc: true number-sections: true -highlight-style: pygments +syntax-highlighting: pygments format: html: code-fold: true diff --git a/docs/output-formats/_document-options-section-numbering.md b/docs/output-formats/_document-options-section-numbering.md index 6b1b6978e6..79287f973a 100644 --- a/docs/output-formats/_document-options-section-numbering.md +++ b/docs/output-formats/_document-options-section-numbering.md @@ -17,3 +17,15 @@ To exclude an individual heading from numbering, add the `.unnumbered` class to ``` markdown ### More Options {.unnumbered} ``` + +::: {.content-visible when-meta="doc-type.typst"} +You can also customize the display of the section numbers with the `section-numbering` YAML option. This option expects a string that describes the numbering schema. For example, the following schema describes numbering sections with numerals, subsection with uppercase letters, and subsubsections with lower case letters, using `.` as a separator: + +```yaml +--- +section-numbering: 1.A.a +--- +``` + +You can read more about specifying the numbering schema in the [Typst documentation for numbering](https://typst.app//docs/reference/model/numbering#parameters-numbering). +::: diff --git a/docs/output-formats/_document-options-syntax-highlighting.md b/docs/output-formats/_document-options-syntax-highlighting.md index 8775ba5854..745457697e 100644 --- a/docs/output-formats/_document-options-syntax-highlighting.md +++ b/docs/output-formats/_document-options-syntax-highlighting.md @@ -1,5 +1,11 @@ ## Syntax Highlighting +::: {.content-visible when-meta="doc-type.typst"} + +{{< include /docs/prerelease/1.9/_pre-release-feature.qmd >}} + +::: + Pandoc will automatically highlight syntax in [fenced code blocks](https://pandoc.org/MANUAL.html#fenced-code-blocks) that are marked with a language name. For example: ```` @@ -10,14 +16,36 @@ Pandoc will automatically highlight syntax in [fenced code blocks](https://pando Pandoc can provide syntax highlighting for over 140 different languages (see the output of `quarto pandoc --list-highlight-languages` for a list of all of them). If you want to provide the appearance of a highlighted code block for a language not supported, just use `default` as the language name. -You can specify the code highlighting style using `highlight-style` and specifying one of the supported themes. Supported themes include: arrow, pygments, tango, espresso, zenburn, kate, monochrome, breezedark, haddock, atom-one, ayu, breeze, dracula, github, gruvbox, monokai, nord, oblivion, printing, radical, solarized, and vim. +You can specify the code highlighting style using `syntax-highlighting` and specifying one of the supported themes. Supported themes include: a11y, arrow, pygments, tango, espresso, zenburn, kate, monochrome, breezedark, haddock, atom-one, ayu, breeze, dracula, github, gruvbox, monokai, nord, oblivion, printing, radical, solarized, and vim. For example: ``` yaml -highlight-style: github +syntax-highlighting: github ``` +In addition to theme names, `syntax-highlighting` accepts two special values: + +- `none` --- disables syntax highlighting entirely. +- `idiomatic` --- delegates highlighting to the output format's native system instead of Pandoc's built-in Skylighting engine. + +::: {.content-visible when-meta="doc-type.pdf"} +For LaTeX/PDF output, `syntax-highlighting: idiomatic` uses the LaTeX `listings` package for code highlighting instead of Pandoc's default approach (which uses `fancyvrb` with `\Shaded`/`\Highlighting` environments). This may be preferred when working with LaTeX templates or publishers that expect `listings`-based code blocks. +::: + +::::: {.content-visible when-meta="doc-type.typst"} + +::: callout-important +## Changed Default for Typst + +Starting with Quarto 1.9, Typst output uses Pandoc's Skylighting engine for syntax highlighting by default, with the same themes available as HTML and LaTeX. Previously, Typst used its own native code highlighting. + +To restore the previous behavior, set `syntax-highlighting: idiomatic`. +::: + +For Typst, setting `syntax-highlighting: idiomatic` delegates highlighting to Typst's built-in code highlighting. In this mode, Typst receives plain fenced code blocks and applies its [own styling](https://typst.app/docs/reference/text/raw/#styling). This may be preferred when using custom Typst templates that style code blocks. +::::: + Highlighting themes can provide either a single highlighting definition or two definitions, one optimized for a light colored background and another optimized for a dark color background. When available, Quarto will automatically select the appropriate style based upon the code chunk background color's darkness. You may always opt to specify the full name (e.g. `atom-one-dark`) to bypass this automatic behavior. By default, code is highlighted using the `arrow` theme, which is optimized for accessibility. Here are examples of the `arrow` light and dark themes: diff --git a/docs/output-formats/_document-options-toc.md b/docs/output-formats/_document-options-toc.md index 1c69c749ee..905fb66118 100644 --- a/docs/output-formats/_document-options-toc.md +++ b/docs/output-formats/_document-options-toc.md @@ -17,4 +17,12 @@ If you want to exclude a heading from the table of contents, add both the `.unnu ``` markdown ### More Options {.unnumbered .unlisted} -``` \ No newline at end of file +``` + +::: {.content-visible when-meta="doc-type.typst"} +The `toc-indent` option controls how far entries are indented in the displayed table of contents. The default is equivalent to: + +```{.yaml} +toc-indent: 1.5em +``` +::: \ No newline at end of file diff --git a/docs/output-formats/html-code.qmd b/docs/output-formats/html-code.qmd index 5c9cd07196..a74deac750 100644 --- a/docs/output-formats/html-code.qmd +++ b/docs/output-formats/html-code.qmd @@ -235,7 +235,7 @@ Pandoc will automatically highlight syntax in [fenced code blocks](https://pando Pandoc can provide syntax highlighting for over 140 different languages (see the output of `quarto pandoc --list-highlight-languages` for a list of all of them). If you want to provide the appearance of a highlighted code block for a language not supported, just use `default` as the language name. -You can specify the code highlighting style using `highlight-style` and specifying one of the supported themes. These themes are "adaptive", which means they will automatically switch between a dark and light mode based upon the theme of the website. These are designed to work well with sites that include a dark and light mode. +You can specify the code highlighting style using `syntax-highlighting` and specifying one of the supported themes. These themes are "adaptive", which means they will automatically switch between a dark and light mode based upon the theme of the website. These are designed to work well with sites that include a dark and light mode. - a11y - arrow @@ -267,10 +267,10 @@ As well as an additional set of extended themes, including: - solarized - vim-dark -The `highlight-style` option determines which theme is used. For example: +The `syntax-highlighting` option determines which theme is used. For example: ``` yaml -highlight-style: github +syntax-highlighting: github ``` Highlighting themes can provide either a single highlighting definition or two definitions, one optimized for a light colored background and another optimized for a dark color background. When available, Quarto will automatically select the appropriate style based upon the code chunk background color's darkness. Users may always opt to specify the full name (e.g. `atom-one-dark`) to by pass this automatic behavior. @@ -281,19 +281,19 @@ Examples of the light and dark themes: #### Arrow (light) -![](images/arrow.png){fig.alt="A block of code showcasing the Arrow (light) theme."} +![](images/arrow.png){fig-alt="A block of code showcasing the Arrow (light) theme."} #### Arrow (dark) -![](images/arrow-dark.png){fig.alt="A block of code showcasing the Arrow (dark) theme."} +![](images/arrow-dark.png){fig-alt="A block of code showcasing the Arrow (dark) theme."} #### Ayu (light) -![](images/ayu.png){fig.alt="A block of code showcasing the Ayu (light) theme."} +![](images/ayu.png){fig-alt="A block of code showcasing the Ayu (light) theme."} #### Ayu (dark) -![](images/ayu-dark.png){.preview-image fig.alt="A block of code showcasing the Ayu (dark) theme."} +![](images/ayu-dark.png){.preview-image fig-alt="A block of code showcasing the Ayu (dark) theme."} ### Custom Highlighting @@ -303,7 +303,7 @@ For example: ``` yaml --- -highlight-style: custom.theme +syntax-highlighting: custom.theme --- ``` @@ -311,13 +311,13 @@ In addition, if you'd like to provide adaptive themes, you may also pass both a ``` yaml --- -highlight-style: +syntax-highlighting: light: custom-light.theme dark: custom-dark.theme --- ``` -Note that as with adaptive text higlighting themes, when you provide a dark and light `highlight-style`, background colors specified in the themes will be ignored in favor of the overall theme specified background colors. +Note that as with adaptive text higlighting themes, when you provide a dark and light `syntax-highlighting`, background colors specified in the themes will be ignored in favor of the overall theme specified background colors. {{< include _code-annotation.md >}} diff --git a/docs/output-formats/ms-word.qmd b/docs/output-formats/ms-word.qmd index babcc9ec91..b16bcc8cb3 100644 --- a/docs/output-formats/ms-word.qmd +++ b/docs/output-formats/ms-word.qmd @@ -14,7 +14,7 @@ format: docx: toc: true number-sections: true - highlight-style: github + syntax-highlighting: github --- ``` diff --git a/docs/output-formats/pdf-basics.qmd b/docs/output-formats/pdf-basics.qmd index 5f364f2a3f..8f572b03ec 100644 --- a/docs/output-formats/pdf-basics.qmd +++ b/docs/output-formats/pdf-basics.qmd @@ -2,6 +2,8 @@ title: PDF Basics format: html pdf-standard-latex-examples: true +doc-type: + pdf: true --- ## Overview @@ -60,7 +62,6 @@ See the [Output Options] section below for additional details on customizing LaT {{< include _document-options-begin.md >}} - ## Output Options There are numerous options available for customizing PDF output, including: diff --git a/docs/output-formats/typst.qmd b/docs/output-formats/typst.qmd index 5109bb4157..e84e23cfe2 100644 --- a/docs/output-formats/typst.qmd +++ b/docs/output-formats/typst.qmd @@ -4,6 +4,8 @@ tbl-colwidths: [35,65] aliases: - /docs/prerelease/1.4/typst.html pdf-standard-typst-examples: true +doc-type: + typst: true # project: # pre-render: # - quarto run ../../tools/snapshot-typst.ts examples/gt-temps.qmd images/typst-tables-gt-temps.png @@ -121,27 +123,7 @@ Then, any unspecified margins will inherit from the default margins. The `columns` option expects a number - the number of columns your body content should have. The default template sets `columns` to `1`. -{{< include /docs/output-formats/_document-options-toc.md >}} - -The `toc-indent` option controls how far entries are indented in the displayed table of contents. The default is equivalent to: - -```{.yaml} -toc-indent: 1.5em -``` - -{{< include /docs/output-formats/_document-options-section-numbering.md >}} - -You can also customize the display of the section numbers with the `section-numbering` YAML option. This option expects a string that describes the numbering schema. For example, the following schema describes numbering sections with numerals, subsection with uppercase letters, and subsubsections with lower case letters, using `.` as a separator: - -```yaml ---- -section-numbering: 1.A.a ---- -``` - -You can read more about specifying the numbering schema in the [Typst documentation for numbering](https://typst.app//docs/reference/model/numbering#parameters-numbering). - -{{< include /docs/output-formats/_code-annotation.md >}} +{{< include /docs/output-formats/_document-options-begin.md >}} ## Article Layout {#article-layout} diff --git a/docs/presentations/revealjs/index.qmd b/docs/presentations/revealjs/index.qmd index 02e024f9b9..3aaf670a9c 100644 --- a/docs/presentations/revealjs/index.qmd +++ b/docs/presentations/revealjs/index.qmd @@ -175,7 +175,15 @@ Custom footer text ## Code Blocks -Most of the core capabilities of Quarto [HTML Code Blocks](/docs/output-formats/html-code.qmd) are available for Reveal slides, including code folding, code copy, and the ability to pick a custom syntax highlighting theme. Note that if you choose a dark Reveal theme then the default Quarto dark syntax highlighting theme will be used. +Most of the core capabilities of Quarto [HTML Code Blocks](/docs/output-formats/html-code.qmd) are available for Reveal slides, including code folding, code copy, and the ability to pick a custom syntax highlighting theme. + +### Syntax Highlighting + +You can specify the code highlighting style using the `syntax-highlighting` option. If you choose a dark Reveal theme then the default Quarto dark syntax highlighting theme will be used. See [HTML Code Blocks: Highlighting](/docs/output-formats/html-code.qmd#highlighting) for the full list of available themes. + +::: callout-note +`syntax-highlighting: idiomatic` is not currently supported for RevealJS presentations. If specified, Quarto falls back to the default Skylighting highlighting with a warning. +::: ### Line Highlighting diff --git a/renv.lock b/renv.lock index ad885a7fcb..ae61241e50 100644 --- a/renv.lock +++ b/renv.lock @@ -1135,6 +1135,60 @@ "Maintainer": "Matthew Lincoln ", "Repository": "P3M" }, + "colorspace": { + "Package": "colorspace", + "Version": "2.1-2", + "Source": "Repository", + "Date": "2025-09-22", + "Title": "A Toolbox for Manipulating and Assessing Colors and Palettes", + "Authors@R": "c(person(given = \"Ross\", family = \"Ihaka\", role = \"aut\", email = \"ihaka@stat.auckland.ac.nz\"), person(given = \"Paul\", family = \"Murrell\", role = \"aut\", email = \"paul@stat.auckland.ac.nz\", comment = c(ORCID = \"0000-0002-3224-8858\")), person(given = \"Kurt\", family = \"Hornik\", role = \"aut\", email = \"Kurt.Hornik@R-project.org\", comment = c(ORCID = \"0000-0003-4198-9911\")), person(given = c(\"Jason\", \"C.\"), family = \"Fisher\", role = \"aut\", email = \"jfisher@usgs.gov\", comment = c(ORCID = \"0000-0001-9032-8912\")), person(given = \"Reto\", family = \"Stauffer\", role = \"aut\", email = \"Reto.Stauffer@uibk.ac.at\", comment = c(ORCID = \"0000-0002-3798-5507\")), person(given = c(\"Claus\", \"O.\"), family = \"Wilke\", role = \"aut\", email = \"wilke@austin.utexas.edu\", comment = c(ORCID = \"0000-0002-7470-9261\")), person(given = c(\"Claire\", \"D.\"), family = \"McWhite\", role = \"aut\", email = \"claire.mcwhite@utmail.utexas.edu\", comment = c(ORCID = \"0000-0001-7346-3047\")), person(given = \"Achim\", family = \"Zeileis\", role = c(\"aut\", \"cre\"), email = \"Achim.Zeileis@R-project.org\", comment = c(ORCID = \"0000-0003-0918-3766\")))", + "Description": "Carries out mapping between assorted color spaces including RGB, HSV, HLS, CIEXYZ, CIELUV, HCL (polar CIELUV), CIELAB, and polar CIELAB. Qualitative, sequential, and diverging color palettes based on HCL colors are provided along with corresponding ggplot2 color scales. Color palette choice is aided by an interactive app (with either a Tcl/Tk or a shiny graphical user interface) and shiny apps with an HCL color picker and a color vision deficiency emulator. Plotting functions for displaying and assessing palettes include color swatches, visualizations of the HCL space, and trajectories in HCL and/or RGB spectrum. Color manipulation functions include: desaturation, lightening/darkening, mixing, and simulation of color vision deficiencies (deutanomaly, protanomaly, tritanomaly). Details can be found on the project web page at and in the accompanying scientific paper: Zeileis et al. (2020, Journal of Statistical Software, ).", + "Depends": [ + "R (>= 3.0.0)", + "methods" + ], + "Imports": [ + "graphics", + "grDevices", + "stats" + ], + "Suggests": [ + "datasets", + "utils", + "KernSmooth", + "MASS", + "kernlab", + "mvtnorm", + "vcd", + "tcltk", + "shiny", + "shinyjs", + "ggplot2", + "dplyr", + "scales", + "grid", + "png", + "jpeg", + "knitr", + "rmarkdown", + "RColorBrewer", + "rcartocolor", + "scico", + "viridis", + "wesanderson" + ], + "VignetteBuilder": "knitr", + "License": "BSD_3_clause + file LICENSE", + "URL": "https://colorspace.R-Forge.R-project.org/, https://hclwizard.org/", + "BugReports": "https://colorspace.R-Forge.R-project.org/contact.html", + "LazyData": "yes", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Ross Ihaka [aut], Paul Murrell [aut] (ORCID: ), Kurt Hornik [aut] (ORCID: ), Jason C. Fisher [aut] (ORCID: ), Reto Stauffer [aut] (ORCID: ), Claus O. Wilke [aut] (ORCID: ), Claire D. McWhite [aut] (ORCID: ), Achim Zeileis [aut, cre] (ORCID: )", + "Maintainer": "Achim Zeileis ", + "Repository": "P3M" + }, "commonmark": { "Package": "commonmark", "Version": "2.0.0",