Skip to content

Commit 7c8fd21

Browse files
extend brand logo tests to revealjs and typst
the extra tests were written by claude with gordon very much in the loop
1 parent cf0d0c7 commit 7c8fd21

27 files changed

+508
-4
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
title: brand-mode and logos
3+
format:
4+
revealjs: default
5+
typst:
6+
keep-typ: true
7+
brand:
8+
logo:
9+
images:
10+
sun:
11+
path: sun-face.png
12+
alt: "Sun face image"
13+
moon:
14+
path: moon-face.png
15+
alt: "Moon face image"
16+
medium:
17+
light: sun
18+
dark: moon
19+
color:
20+
foreground:
21+
light: '#222'
22+
dark: '#eee'
23+
background:
24+
light: '#eee'
25+
dark: '#222'
26+
typography:
27+
headings:
28+
color:
29+
light: '#429'
30+
dark: '#54e'
31+
_quarto:
32+
tests:
33+
revealjs:
34+
ensureHtmlElements:
35+
-
36+
- 'img[src="sun-face.png"][alt="Sun face image"]'
37+
-
38+
- 'img[src="moon-face.png"][alt="Moon face image"]'
39+
typst:
40+
ensureTypstFileRegexMatches:
41+
-
42+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("sun-face\.png", width: 1\.5in, alt: "Sun face image"\)\)'
43+
-
44+
- 'background.*moon-face\.png'
45+
---
46+
47+
## Here we go
48+
49+
- Testing image definition with path and alt text
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: brand-mode and logos
3+
format:
4+
revealjs: default
5+
typst:
6+
keep-typ: true
7+
brand:
8+
logo:
9+
images:
10+
sun: sun-face.png
11+
moon: moon-face.png
12+
medium:
13+
light: sun
14+
dark: moon
15+
color:
16+
foreground:
17+
light: '#222'
18+
dark: '#eee'
19+
background:
20+
light: '#eee'
21+
dark: '#222'
22+
typography:
23+
headings:
24+
color:
25+
light: '#429'
26+
dark: '#54e'
27+
_quarto:
28+
tests:
29+
revealjs:
30+
ensureHtmlElements:
31+
-
32+
- 'img[src="sun-face.png"]'
33+
-
34+
- 'img[src="moon-face.png"]'
35+
typst:
36+
ensureTypstFileRegexMatches:
37+
-
38+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("sun-face\.png", width: 1\.5in\)\)'
39+
-
40+
- 'background.*moon-face\.png'
41+
---
42+
43+
## Here we go
44+
45+
- Testing image definition with just path
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
---
2+
title: brand-mode and logos
3+
format:
4+
revealjs: default
5+
typst:
6+
keep-typ: true
7+
brand:
8+
logo:
9+
large:
10+
light: sun-face.png
11+
dark: moon-face.png
12+
color:
13+
foreground:
14+
light: '#222'
15+
dark: '#eee'
16+
background:
17+
light: '#eee'
18+
dark: '#222'
19+
typography:
20+
headings:
21+
color:
22+
light: '#429'
23+
dark: '#54e'
24+
_quarto:
25+
tests:
26+
revealjs:
27+
ensureHtmlElements:
28+
-
29+
- 'img[src="sun-face.png"]'
30+
-
31+
- 'img[src="moon-face.png"]'
32+
typst:
33+
ensureTypstFileRegexMatches:
34+
-
35+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("sun-face\.png", width: 1\.5in\)\)'
36+
-
37+
- 'background.*moon-face\.png'
38+
---
39+
40+
## Here we go
41+
42+
- Testing large logo fallback when no medium logo is defined
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
title: brand-mode and logos
3+
format:
4+
revealjs: default
5+
typst:
6+
keep-typ: true
7+
brand:
8+
logo:
9+
medium:
10+
light: sun-face.png
11+
# dark mode missing
12+
color:
13+
foreground:
14+
light: '#222'
15+
dark: '#eee'
16+
background:
17+
light: '#eee'
18+
dark: '#222'
19+
typography:
20+
headings:
21+
color:
22+
light: '#429'
23+
dark: '#54e'
24+
_quarto:
25+
tests:
26+
revealjs:
27+
ensureHtmlElements:
28+
-
29+
- 'img[src="sun-face.png"]'
30+
typst:
31+
ensureTypstFileRegexMatches:
32+
-
33+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("sun-face\.png", width: 1\.5in\)\)'
34+
---
35+
36+
## Here we go
37+
38+
- Testing missing dark mode logo
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
title: brand-mode and logos
3+
format:
4+
revealjs: default
5+
typst:
6+
keep-typ: true
7+
brand:
8+
logo:
9+
images:
10+
sun: sun-face.png
11+
moon: moon-face.png
12+
medium:
13+
light: sun # Named reference
14+
dark: moon-face.png # Direct path
15+
color:
16+
foreground:
17+
light: '#222'
18+
dark: '#eee'
19+
background:
20+
light: '#eee'
21+
dark: '#222'
22+
typography:
23+
headings:
24+
color:
25+
light: '#429'
26+
dark: '#54e'
27+
_quarto:
28+
tests:
29+
revealjs:
30+
ensureHtmlElements:
31+
-
32+
- 'img[src="sun-face.png"]'
33+
-
34+
- 'img[src="moon-face.png"]'
35+
typst:
36+
ensureTypstFileRegexMatches:
37+
-
38+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("sun-face\.png", width: 1\.5in\)\)'
39+
-
40+
- 'background.*moon-face\.png'
41+
---
42+
43+
## Here we go
44+
45+
- Testing mixed path types - named reference and direct path

tests/docs/smoke-all/brand/logo/choose-logo-resource.qmd

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: brand and base logo
33
format:
44
dashboard: default
5+
revealjs: default
6+
typst:
7+
output-ext: typ
58
brand:
69
logo:
710
images:
@@ -26,6 +29,11 @@ _quarto:
2629
-
2730
- 'img[src="posit-logo-2024.svg"][class="slide-logo"]'
2831
- []
32+
typst:
33+
ensureTypstFileRegexMatches:
34+
-
35+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("posit-logo-2024.svg", width: 1\.5in, alt: "posit logo"\)\)'
36+
- []
2937
---
3038

3139
{{< lipsum 4 >}}

tests/docs/smoke-all/brand/logo/dark-logo.qmd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
title: brand with dark and light logos
33
format:
44
dashboard: default
5+
revealjs: default
6+
typst:
7+
keep-typ: true
58
brand:
69
logo:
710
images:
@@ -31,6 +34,16 @@ _quarto:
3134
- 'img[src="quarto.png"][alt="quarto logo"][class="navbar-logo light-content d-inline-block"]'
3235
- 'img[src="quarto-dark.png"][alt="quarto dark logo"][class="navbar-logo dark-content d-inline-block"]'
3336
- []
37+
revealjs:
38+
ensureHtmlElements:
39+
-
40+
- 'img[src="quarto.png"][alt="quarto logo"]'
41+
- []
42+
typst:
43+
ensureTypstFileRegexMatches:
44+
-
45+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("quarto.png", width: 1\.5in, alt: "quarto logo"\)\)'
46+
- []
3447
---
3548

3649
{{< lipsum 4 >}}

tests/docs/smoke-all/brand/logo/dark-mode-no-dark-logo.qmd

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ format:
55
theme:
66
light: default
77
dark: darkly # Explicitly enable dark mode
8+
revealjs: default
9+
typst:
10+
keep-typ: true
811
brand:
912
color:
1013
foreground:
@@ -31,6 +34,16 @@ _quarto:
3134
# For dark mode, should it use the light logo since no dark logo exists?
3235
- 'img[src="quarto.png"][alt="light logo"][class="navbar-logo dark-content d-inline-block"]'
3336
- []
37+
revealjs:
38+
ensureHtmlElements:
39+
-
40+
- 'img[src="quarto.png"][alt="light logo"]'
41+
- []
42+
typst:
43+
ensureTypstFileRegexMatches:
44+
-
45+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("quarto.png", width: 1\.5in, alt: "light logo"\)\)'
46+
- []
3447
---
3548

3649
{{< lipsum 4 >}}

tests/docs/smoke-all/brand/logo/dark-mode-no-light-logo.qmd

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ format:
44
dashboard:
55
theme:
66
light: default
7-
dark: darkly # Explicitly enable dark mode
7+
dark: darkly
8+
revealjs: default
9+
typst:
10+
keep-typ: true
11+
brand-mode: dark
812
brand:
913
color:
1014
foreground:
@@ -20,17 +24,24 @@ brand:
2024
alt: dark logo
2125
medium:
2226
dark: dark-logo
23-
# No light variant defined - what happens?
2427
_quarto:
2528
tests:
2629
dashboard:
2730
ensureHtmlElements:
2831
-
29-
# Dark mode should use the dark logo
3032
- 'img[src="posit-logo-2024.svg"][alt="dark logo"][class="navbar-logo dark-content d-inline-block"]'
31-
# For light mode, should it use the dark logo since no light logo exists?
3233
- 'img[src="posit-logo-2024.svg"][alt="dark logo"][class="navbar-logo light-content d-inline-block"]'
3334
- []
35+
revealjs:
36+
ensureHtmlElements:
37+
-
38+
- 'img[src="posit-logo-2024.svg"][alt="dark logo"]'
39+
- []
40+
typst:
41+
ensureTypstFileRegexMatches:
42+
-
43+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("posit-logo-2024.svg", width: 1\.5in, alt: "dark logo"\)\)'
44+
- []
3445
---
3546

3647
{{< lipsum 4 >}}

tests/docs/smoke-all/brand/logo/dark-mode-search-priority.qmd

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
title: Size Inheritance
33
format:
44
dashboard: default
5+
revealjs: default
6+
typst:
7+
output-ext: typ
8+
brand-mode: dark
59
brand:
610
logo:
711
images:
@@ -33,6 +37,17 @@ _quarto:
3337
- 'img[src="small-logo.png"][alt="small logo"][class="navbar-logo light-content d-inline-block"]'
3438
- 'img[src="dark-logo.png"][alt="dark logo"][class="navbar-logo dark-content d-inline-block"]'
3539
- []
40+
revealjs:
41+
ensureHtmlElements:
42+
-
43+
# In dark mode with revealjs, should use large.dark
44+
- 'img[src="dark-logo.png"][alt="dark logo"]'
45+
- []
46+
typst:
47+
ensureTypstFileRegexMatches:
48+
-
49+
- 'background: align\(left\+top, box\(inset: 0.75in, image\("dark-logo.png", width: 1\.5in, alt: "dark logo"\)\)'
50+
- []
3651
---
3752

3853
{{< lipsum 4 >}}

0 commit comments

Comments
 (0)