Skip to content

Commit a276172

Browse files
authored
Merge branch 'main' into 1.8/lua_api_changes
2 parents 81302b0 + c3d19c6 commit a276172

File tree

15 files changed

+326
-513
lines changed

15 files changed

+326
-513
lines changed

_freeze/docs/authoring/cross-references/execute-results/html.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
-1.33 KB
Loading

_quarto.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,6 @@ website:
409409
- docs/publishing/quarto-pub.qmd
410410
- docs/publishing/github-pages.qmd
411411
- docs/publishing/rstudio-connect.qmd
412-
- docs/publishing/posit-cloud.qmd
413412
- docs/publishing/netlify.qmd
414413
- docs/publishing/confluence.qmd
415414
- docs/publishing/hugging-face.qmd
@@ -474,9 +473,10 @@ website:
474473
- docs/extensions/formats.qmd
475474
- docs/extensions/revealjs.qmd
476475
- docs/extensions/project-types.qmd
476+
- docs/extensions/starter-templates.qmd
477477
- text: "Metadata Extensions"
478478
href: docs/extensions/metadata.qmd
479-
- docs/extensions/starter-templates.qmd
479+
- docs/extensions/brand.qmd
480480

481481
- id: reference
482482
title: "Reference"
@@ -662,8 +662,6 @@ website:
662662
href: docs/projects/binder.qmd
663663
- text: Connect Emails
664664
href: docs/prerelease/1.4/email.qmd
665-
- text: Cloud Publishing
666-
href: docs/publishing/posit-cloud.qmd
667665
- text: Lightbox Images
668666
href: docs/output-formats/html-lightbox-figures.qmd
669667
- text: Lua Changes

_redirects

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
1-
/download/latest/changelog.md-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/changelog.md
2-
/download/latest/quarto-checksums.txt https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-checksums.txt
3-
/download/latest/quarto-linux-amd64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-linux-amd64.deb
4-
/download/latest/quarto-linux-amd64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-linux-amd64.tar.gz
5-
/download/latest/quarto-linux-arm64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-linux-arm64.deb
6-
/download/latest/quarto-linux-arm64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-linux-arm64.tar.gz
7-
/download/latest/quarto-linux-rhel7-amd64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-linux-rhel7-amd64.tar.gz
8-
/download/latest/quarto-macos.pkg https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-macos.pkg
9-
/download/latest/quarto-macos.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-macos.tar.gz
10-
/download/latest/quarto-win.msi https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-win.msi
11-
/download/latest/quarto-win.zip https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24-win.zip
12-
/download/latest/quarto-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.24/quarto-1.8.24.tar.gz
13-
/download/prerelease/changelog.md-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/changelog.md
14-
/download/prerelease/quarto-checksums.txt https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-checksums.txt
15-
/download/prerelease/quarto-linux-amd64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-linux-amd64.deb
16-
/download/prerelease/quarto-linux-amd64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-linux-amd64.tar.gz
17-
/download/prerelease/quarto-linux-arm64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-linux-arm64.deb
18-
/download/prerelease/quarto-linux-arm64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-linux-arm64.tar.gz
19-
/download/prerelease/quarto-macos.pkg https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-macos.pkg
20-
/download/prerelease/quarto-macos.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-macos.tar.gz
21-
/download/prerelease/quarto-win.msi https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-win.msi
22-
/download/prerelease/quarto-win.zip https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2-win.zip
23-
/download/prerelease/quarto-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.2/quarto-1.9.2.tar.gz
1+
/download/latest/changelog.md-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/changelog.md
2+
/download/latest/quarto-checksums.txt https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-checksums.txt
3+
/download/latest/quarto-linux-amd64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-linux-amd64.deb
4+
/download/latest/quarto-linux-amd64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-linux-amd64.tar.gz
5+
/download/latest/quarto-linux-arm64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-linux-arm64.deb
6+
/download/latest/quarto-linux-arm64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-linux-arm64.tar.gz
7+
/download/latest/quarto-linux-rhel7-amd64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-linux-rhel7-amd64.tar.gz
8+
/download/latest/quarto-macos.pkg https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-macos.pkg
9+
/download/latest/quarto-macos.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-macos.tar.gz
10+
/download/latest/quarto-win.msi https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-win.msi
11+
/download/latest/quarto-win.zip https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25-win.zip
12+
/download/latest/quarto-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.8.25/quarto-1.8.25.tar.gz
13+
/download/prerelease/changelog.md-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/changelog.md
14+
/download/prerelease/quarto-checksums.txt https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-checksums.txt
15+
/download/prerelease/quarto-linux-amd64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-linux-amd64.deb
16+
/download/prerelease/quarto-linux-amd64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-linux-amd64.tar.gz
17+
/download/prerelease/quarto-linux-arm64.deb https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-linux-arm64.deb
18+
/download/prerelease/quarto-linux-arm64.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-linux-arm64.tar.gz
19+
/download/prerelease/quarto-macos.pkg https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-macos.pkg
20+
/download/prerelease/quarto-macos.tar.gz https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-macos.tar.gz
21+
/download/prerelease/quarto-win.msi https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-win.msi
22+
/download/prerelease/quarto-win.zip https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3-win.zip
23+
/download/prerelease/quarto-. https://github.com/quarto-dev/quarto-cli/releases/download/v1.9.3/quarto-1.9.3.tar.gz

docs/authoring/brand.qmd

Lines changed: 156 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ Quarto will detect the presence of `_brand.yml` and automatically apply the bran
3636
You can create a `_brand.yml` file outside of a Quarto project (e.g. without a `_quarto.yml`).
3737
In this case, `_brand.yml` will automatically apply to documents in the same directory.
3838

39+
```{.yaml filename="_brand.yml"}
40+
color:
41+
background: "#eeeeee"
42+
```
43+
44+
3945
You can also set brand options in a document by specifying brand elements under the `brand` option:
4046

4147
```{.yaml filename="document.qmd"}
@@ -73,9 +79,59 @@ brand: brand/_brand.yml
7379

7480
Paths specified in `_brand.yml` are relative to the location of the brand file.
7581

76-
### Dark Brand
82+
### Light and Dark Colors
83+
84+
To specify colors for both light and dark modes using a single brand.yml file, specify any color in `color` or `typography` with an object containing the `light` and `dark` colors:
85+
86+
```{.yaml filename="_brand.yml"}
87+
color:
88+
background:
89+
light: "#ffffff"
90+
dark: "#333333"
91+
foreground:
92+
light: "#333333"
93+
dark: "#ffffff"
94+
typography:
95+
headings:
96+
color:
97+
light: "#111144"
98+
dark: "#d0d0ff"
99+
```
100+
101+
This also works with the brand specified directly in the document metadata:
77102

78-
As with [Themes](/docs/output-formats/html-themes.qmd#dark-mode), you can specify both light and dark brands, making both a light and a dark version of your output available:
103+
104+
```{.yaml filename="document.qmd"}
105+
---
106+
brand:
107+
color:
108+
background:
109+
light: "#ffffff"
110+
dark: "#333333"
111+
foreground:
112+
light: "#333333"
113+
dark: "#ffffff"
114+
typography:
115+
headings:
116+
color:
117+
light: "#111144"
118+
dark: "#d0d0ff"
119+
---
120+
```
121+
122+
123+
::: {.callout-warning}
124+
125+
## Limitation
126+
127+
Colors in [the `palette`](#color) cannot currently be specified with `light` and `dark` variants.
128+
129+
:::
130+
131+
132+
### Light and Dark Brands
133+
134+
If you prefer to author separate light and dark brands for light and dark mode, or you need to customize non-color properties, you can separate the brands into their own files, and specify `light` and `dark` brand files:
79135

80136
```{.yaml filename="document.qmd"}
81137
---
@@ -85,6 +141,8 @@ brand:
85141
---
86142
```
87143

144+
This is similar to how [Themes](/docs/output-formats/html-themes.qmd#dark-mode) work.
145+
88146
This also works with brands specified directly in the document:
89147

90148
```{.yaml filename="document.qmd"}
@@ -109,19 +167,24 @@ brand:
109167
dark: dark-brand.yml
110168
```
111169

112-
113170
::: {.callout-warning}
114171

115172
## Limitation
116173

117-
The `revealjs` format does not support switching between light and dark modes.
174+
Brand metadata cannot currently be specified directly in `_quarto.yml`, only via the file syntax.
118175

119-
:::
176+
:::
120177

121178

122-
#### Typst
123179

124-
To choose a dark brand in Typst output use `brand-mode: dark`:
180+
### Brand Mode
181+
182+
The Typst and revealjs formats do not produce outputs which can toggle between light and dark mode dynamically.
183+
184+
By default, Typst and revealjs formats will render using the light brand.
185+
Set `brand-mode: dark` to render using the dark brand.
186+
187+
Typst:
125188

126189
```{.yaml filename="document.qmd"}
127190
---
@@ -131,6 +194,16 @@ format:
131194
---
132195
```
133196

197+
Revealjs:
198+
199+
```{.yaml filename="document.qmd"}
200+
---
201+
format:
202+
revealjs:
203+
brand-mode: dark
204+
---
205+
```
206+
134207

135208
## Brand Elements
136209

@@ -257,15 +330,7 @@ logo:
257330
path: https://quarto.org/quarto.png
258331
alt: "Quarto icon"
259332
small: quarto-logo
260-
```
261-
262-
::: {.callout-warning}
263-
264-
## Limitation
265-
266-
The **brand.yml** specification allows you to specify a `light` and `dark` version of your logo, but Quarto currently only uses the `light` version.
267-
268-
:::
333+
```
269334

270335
#### Document logo customization
271336

@@ -278,7 +343,15 @@ logo: large
278343
---
279344
```
280345

281-
Or, specify a brand logo and change the alt text:
346+
Or override the brand logo for this document with a logo from a file:
347+
348+
```{.yaml filename="document.qmd"}
349+
---
350+
logo: logo.png
351+
---
352+
```
353+
354+
Or specify a brand logo resource and change the alt text:
282355

283356
```{.yaml filename="document.qmd"}
284357
---
@@ -288,6 +361,21 @@ logo:
288361
---
289362
```
290363

364+
You can also individually customize light and dark logos, with any of the variations shown above:
365+
366+
```{.yaml filename="document.qmd"}
367+
---
368+
logo:
369+
light:
370+
path: large
371+
alt: Alternate alternate text
372+
dark:
373+
path: dark-logo.png
374+
alt: Alternate text for dark logo
375+
---
376+
```
377+
378+
291379
::: {.callout-warning}
292380

293381
## Limitation
@@ -296,35 +384,7 @@ It is [not currently possible](https://github.com/quarto-dev/quarto-cli/issues/1
296384

297385
:::
298386

299-
The Typst implementation allows customization of the logo position at the document level:
300-
301-
```{.yaml filename="document.qmd"}
302-
---
303-
format:
304-
typst:
305-
logo:
306-
width: 1in
307-
location: right-top
308-
padding-right: 0.5in
309-
padding-top: 0.25in
310-
alt: Alternate alternate text
311-
---
312-
```
313-
314-
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
315-
| Option | Description |
316-
+==========================+================================================================================================================================================+
317-
| `width` | Width in CSS units. Default `1.5in`. |
318-
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
319-
| `location` | Location on the page in `X-Y`, where `X` is `left`, `center`, or `right` and Y is `top`, `middle`, or `bottom`. |
320-
| | Applied as Typst [`align`](https://typst.app/docs/reference/layout/align/). |
321-
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
322-
| `padding`, `padding-top`,| Amount of padding to add to each side of the logo, using CSS [`padding`](https://developer.mozilla.org/en-US/docs/Web/CSS/padding) conventions.|
323-
| `padding-right`, | Padding options are applied in alphabetical order. |
324-
| `padding-bottom`, | Applied as Typst [`block.inset`](https://typst.app/docs/reference/layout/block/#parameters-inset). |
325-
| `padding-left` | Default `padding: 0.75in`. |
326-
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
327-
387+
When using `format: typst` you can additionally [customize the logo position](../output-formats/typst.qmd#logo-position).
328388

329389
### Typography
330390

@@ -342,13 +402,6 @@ typography:
342402
The properties you can set for a font under `fonts` depends on the `source`. You can see the other properties available in our [Reference for Brand](/docs/reference/metadata/brand.qmd#font-resource-definitions).
343403

344404

345-
::: {.callout-warning}
346-
## Limitation
347-
348-
HTML formats do not currently support `source: file`.
349-
:::
350-
351-
352405
You can then refer to fonts by `family` in the remaining typography options:
353406

354407
``` {.yaml filename="_brand.yml"}
@@ -534,10 +587,20 @@ Beyond the automatic application of your brand file, you can also directly acces
534587

535588
Some values from the `_brand.yml` configuration file can be accessed via the `brand` shortcode. In particular, you can access colors and logos by name:
536589

537-
- Use `{{{< brand color COLOR_NAME BRAND_MODE >}}}` to return the brand color named `COLOR_NAME` as a string.
538-
- Use `{{{< brand logo LOGO_NAME BRAND_MODE >}}}` to return the brand logo named `LOGO_NAME` as an image.
590+
- Use `{{{< brand color COLOR_NAME VARIANT >}}}` to return the brand color named `COLOR_NAME` as a string.
591+
- Use `{{{< brand logo LOGO_NAME VARIANT >}}}` to return the brand logo named `LOGO_NAME` as an image.
592+
593+
`VARIANT` is optional:
594+
595+
- For the `brand color` shortcode, the default is `light`. To return the color from the [dark brand](#dark-brand) use `dark`.
596+
- For the `brand logo` shortcode, the default is `both`, which will expand to both light and dark logos with the appropriate [classes for mode-specific content](../output-formats/html-themes.qmd#mode-specific-content) so that the light logo shows in light mode and the dark logo shows in dark mode.
597+
598+
::: {.callout-note}
599+
600+
If the `VARIANT` is `light` or `dark`, the `brand logo` shortcode will not add a mode-specific class.
601+
602+
:::
539603

540-
The `BRAND_MODE` is optional and defaults to `light`. To return the color from the [dark brand](#dark-brand) use `dark`.
541604

542605
For example, you could use the shortcode to place a brand image you've named `icon` in a dashboard sidebar:
543606

@@ -632,6 +695,26 @@ For example, you could make a rectangle filled with your `primary` brand color:
632695
```
633696
````
634697

698+
Brand logos are set in dictionaries called `brand-logo` and `brand-logo-images`.
699+
700+
For example, you can write Typst code to insert an image using its resolved path and alt text from `brand.logo.images`:
701+
702+
````{.markdown filename="document.qmd"}
703+
---
704+
format: typst
705+
brand:
706+
logo:
707+
images:
708+
custom:
709+
path: custom.png
710+
alt: custom logo
711+
---
712+
713+
```{=typst}
714+
#image(brand-logo-images.custom.path, alt=brand-logo-images.custom.alt)
715+
```
716+
````
717+
635718
### Lua API
636719

637720
Filters and shortcodes can access brand values using the `brand` Lua module.
@@ -641,11 +724,26 @@ local brand = require('modules/brand/brand')
641724
local primary = brand.get_color('primary')
642725
```
643726

644-
## Migrating to `_brand.yml`: use the `brand` string in `theme`
727+
## Sharing brands across projects
728+
729+
::: callout-warning
730+
731+
Quarto requires all assets, including logos and font files, to live in a single directory tree with `_quarto.yml` at the root. Using a path to a `brand.yml` file outside of that directory tree will not work correctly.
732+
733+
:::
734+
735+
Quarto 1.8 introduces the [brand extension](../extensions/brand.qmd), a Quarto-specific way to distribute brand metadata and assets using a Git repository.
736+
737+
Quarto extensions install to the `_extensions/` subdirectory of your project. You will have a copy of the brand metadata and assets in each project; use [`quarto update`](../extensions/managing.qmd#updating) to update the brand extension from its repository.
738+
739+
Quarto 1.9 will introduce `quarto use brand` for a simpler way to share brands. Watch [this page on the prerelease documentation](https://prerelease.quarto.org/docs/authoring/brand.html#sharing-brands-across-projects) for availability.
740+
741+
742+
## Combining brands and themes
645743

646744
::: callout-note
647745

648-
The following information is only necessary if you are migrating projects created with Quarto 1.5 and earlier to use `_brand.yml`.
746+
The following information is only necessary if you want to combine bootswatch themes with `_brand.yml`.
649747

650748
:::
651749

0 commit comments

Comments
 (0)