Skip to content

Commit e14ae07

Browse files
authored
make schema more lenient for custom giscus themes.
Closes #3105.
1 parent 1e53d8d commit e14ae07

File tree

6 files changed

+79
-58
lines changed

6 files changed

+79
-58
lines changed

news/changelog-1.3.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,5 @@
3737
- Warn instead of crash on bad URI ([#3220](https://github.com/quarto-dev/quarto-cli/issues/3220))
3838
- ensure `video` shortcode works with `embed-resources` and `self-contained` ([#3310](https://github.com/quarto-dev/quarto-cli/issues/3310))
3939
- Add optional `rel` attribute to navigation links ([#3212](https://github.com/quarto-dev/quarto-cli/issues/3212))
40-
- Use the right port when CRI is initialized multiple times ([#3066](https://github.com/quarto-dev/quarto-cli/3066))
40+
- Use the right port when CRI is initialized multiple times ([#3066](https://github.com/quarto-dev/quarto-cli/issues/3066))
41+
- Allow custom themes for giscus ([#3105](https://github.com/quarto-dev/quarto-cli/issues/3105))

src/resources/editor/tools/vs-code.mjs

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8479,16 +8479,21 @@ var require_yaml_intelligence_resources = __commonJS({
84798479
description: "Place the comment input box above or below the comments."
84808480
},
84818481
theme: {
8482-
enum: [
8483-
"light",
8484-
"light_high_contrast",
8485-
"light_protanopia",
8486-
"dark",
8487-
"dark_high_contrast",
8488-
"dark_protanopia",
8489-
"dark_dimmed",
8490-
"transparent_dark",
8491-
"preferred_color_scheme"
8482+
anyOf: [
8483+
"string",
8484+
{
8485+
enum: [
8486+
"light",
8487+
"light_high_contrast",
8488+
"light_protanopia",
8489+
"dark",
8490+
"dark_high_contrast",
8491+
"dark_protanopia",
8492+
"dark_dimmed",
8493+
"transparent_dark",
8494+
"preferred_color_scheme"
8495+
]
8496+
}
84928497
],
84938498
description: "The giscus theme to use when displaying comments."
84948499
},
@@ -20090,12 +20095,12 @@ var require_yaml_intelligence_resources = __commonJS({
2009020095
mermaid: "%%"
2009120096
},
2009220097
"handlers/mermaid/schema.yml": {
20093-
_internalId: 133552,
20098+
_internalId: 133567,
2009420099
type: "object",
2009520100
description: "be an object",
2009620101
properties: {
2009720102
"mermaid-format": {
20098-
_internalId: 133551,
20103+
_internalId: 133566,
2009920104
type: "enum",
2010020105
enum: [
2010120106
"png",

src/resources/editor/tools/yaml/web-worker.js

Lines changed: 17 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/editor/tools/yaml/yaml-intelligence-resources.json

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,16 +1455,21 @@
14551455
"description": "Place the comment input box above or below the comments."
14561456
},
14571457
"theme": {
1458-
"enum": [
1459-
"light",
1460-
"light_high_contrast",
1461-
"light_protanopia",
1462-
"dark",
1463-
"dark_high_contrast",
1464-
"dark_protanopia",
1465-
"dark_dimmed",
1466-
"transparent_dark",
1467-
"preferred_color_scheme"
1458+
"anyOf": [
1459+
"string",
1460+
{
1461+
"enum": [
1462+
"light",
1463+
"light_high_contrast",
1464+
"light_protanopia",
1465+
"dark",
1466+
"dark_high_contrast",
1467+
"dark_protanopia",
1468+
"dark_dimmed",
1469+
"transparent_dark",
1470+
"preferred_color_scheme"
1471+
]
1472+
}
14681473
],
14691474
"description": "The giscus theme to use when displaying comments."
14701475
},
@@ -13066,12 +13071,12 @@
1306613071
"mermaid": "%%"
1306713072
},
1306813073
"handlers/mermaid/schema.yml": {
13069-
"_internalId": 133552,
13074+
"_internalId": 133567,
1307013075
"type": "object",
1307113076
"description": "be an object",
1307213077
"properties": {
1307313078
"mermaid-format": {
13074-
"_internalId": 133551,
13079+
"_internalId": 133566,
1307513080
"type": "enum",
1307613081
"enum": [
1307713082
"png",

src/resources/schema/definitions.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -245,18 +245,20 @@
245245
enum: [top, bottom]
246246
description: Place the comment input box above or below the comments.
247247
theme:
248-
enum:
249-
[
250-
light,
251-
light_high_contrast,
252-
light_protanopia,
253-
dark,
254-
dark_high_contrast,
255-
dark_protanopia,
256-
dark_dimmed,
257-
transparent_dark,
258-
preferred_color_scheme,
259-
]
248+
anyOf:
249+
- string
250+
- enum:
251+
[
252+
light,
253+
light_high_contrast,
254+
light_protanopia,
255+
dark,
256+
dark_high_contrast,
257+
dark_protanopia,
258+
dark_dimmed,
259+
transparent_dark,
260+
preferred_color_scheme,
261+
]
260262
description: The giscus theme to use when displaying comments.
261263
language:
262264
string:

src/resources/types/schema-types.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -118,15 +118,18 @@ as a discussion number and automatic discussion creation is not supported. */;
118118
In order to work correctly, the repo must be public, with the giscus app installed, and
119119
the discussions feature must be enabled. */;
120120
theme?:
121-
| "light"
122-
| "light_high_contrast"
123-
| "light_protanopia"
124-
| "dark"
125-
| "dark_high_contrast"
126-
| "dark_protanopia"
127-
| "dark_dimmed"
128-
| "transparent_dark"
129-
| "preferred_color_scheme"; /* The giscus theme to use when displaying comments. */
121+
| string
122+
| (
123+
| "light"
124+
| "light_high_contrast"
125+
| "light_protanopia"
126+
| "dark"
127+
| "dark_high_contrast"
128+
| "dark_protanopia"
129+
| "dark_dimmed"
130+
| "transparent_dark"
131+
| "preferred_color_scheme"
132+
); /* The giscus theme to use when displaying comments. */
130133
};
131134
hypothesis?: boolean | {
132135
assetRoot?: string /* The root URL from which assets are loaded. */;

0 commit comments

Comments
 (0)