Skip to content

Commit e62f294

Browse files
committed
Level one list of options
1 parent 6347889 commit e62f294

File tree

5 files changed

+222
-0
lines changed

5 files changed

+222
-0
lines changed

_quarto.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,8 @@ website:
575575
href: docs/reference/metadata/citation.qmd
576576
- text: "Cross-References"
577577
href: docs/reference/metadata/crossref.qmd
578+
- text: "Brand"
579+
href: docs/reference/metadata/brand.qmd
578580
- id: prerelease
579581
title: "Quarto 1.3"
580582
contents:

docs/reference/metadata/brand.json

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
[
2+
{
3+
"name": "brand",
4+
"title": "Brand",
5+
"options": [
6+
{
7+
"name": "meta",
8+
"description": "Metadata for a brand, including the brand name and important links. See [Meta](#meta) for more information"
9+
},
10+
{
11+
"name": "logo",
12+
"description": "Provide definitions and defaults for brand's logo in various formats and sizes. See [Logo](#logo) for more information"
13+
},
14+
{
15+
"name": "color",
16+
"description": "The brand's custom color palette and theme. See [Color](#color) for more information"
17+
},
18+
{
19+
"name": "typography",
20+
"description": "Typography definitions for the brand. See [Typography](#typography) for more information"
21+
},
22+
{
23+
"name": "defaults",
24+
"description": "Default settings"
25+
}
26+
]
27+
},
28+
{
29+
"name": "brand-meta",
30+
"title": "Meta",
31+
"options": [
32+
{
33+
"name": "name",
34+
"description": "The brand name."
35+
},
36+
{
37+
"name": "link",
38+
"description": "Important links for the brand, including social media links. If a single string, it is the brand's home page or website. Additional fields are allowed for internal use.\n"
39+
}
40+
]
41+
},
42+
{
43+
"name": "brand-logo",
44+
"title": "Logo",
45+
"options": [
46+
{
47+
"name": "images",
48+
"description": ""
49+
},
50+
{
51+
"name": "small",
52+
"description": "A link or path to the brand's small-sized logo or icon, or a link or path to both the light and dark versions.\n"
53+
},
54+
{
55+
"name": "medium",
56+
"description": "A link or path to the brand's medium-sized logo, or a link or path to both the light and dark versions.\n"
57+
},
58+
{
59+
"name": "large",
60+
"description": "A link or path to the brand's large- or full-sized logo, or a link or path to both the light and dark versions.\n"
61+
}
62+
]
63+
},
64+
{
65+
"name": "brand-color",
66+
"title": "Color",
67+
"options": [
68+
{
69+
"name": "palette",
70+
"description": "The brand's custom color palette. Any number of colors can be defined, each color having a custom name.\n"
71+
},
72+
{
73+
"name": "foreground",
74+
"description": "The foreground color, used for text."
75+
},
76+
{
77+
"name": "background",
78+
"description": "The background color, used for the page background."
79+
},
80+
{
81+
"name": "primary",
82+
"description": "The primary accent color, i.e. the main theme color. Typically used for hyperlinks, active states, primary action buttons, etc.\n"
83+
},
84+
{
85+
"name": "secondary",
86+
"description": "The secondary accent color. Typically used for lighter text or disabled states.\n"
87+
},
88+
{
89+
"name": "tertiary",
90+
"description": "The tertiary accent color. Typically an even lighter color, used for hover states, accents, and wells.\n"
91+
},
92+
{
93+
"name": "success",
94+
"description": "The color used for positive or successful actions and information."
95+
},
96+
{
97+
"name": "info",
98+
"description": "The color used for neutral or informational actions and information."
99+
},
100+
{
101+
"name": "warning",
102+
"description": "The color used for warning or cautionary actions and information."
103+
},
104+
{
105+
"name": "danger",
106+
"description": "The color used for errors, dangerous actions, or negative information."
107+
},
108+
{
109+
"name": "light",
110+
"description": "A bright color, used as a high-contrast foreground color on dark elements or low-contrast background color on light elements.\n"
111+
},
112+
{
113+
"name": "dark",
114+
"description": "A dark color, used as a high-contrast foreground color on light elements or high-contrast background color on light elements.\n"
115+
},
116+
{
117+
"name": "emphasis",
118+
"description": "A color used to emphasize or highlight text or elements.\n"
119+
},
120+
{
121+
"name": "link",
122+
"description": "The color used for hyperlinks. If not defined, the `primary` color is used.\n"
123+
}
124+
]
125+
},
126+
{
127+
"name": "brand-typography",
128+
"title": "Typography",
129+
"options": [
130+
{
131+
"name": "fonts",
132+
"description": "Font files and definitions for the brand."
133+
},
134+
{
135+
"name": "base",
136+
"description": "The base font settings for the brand. These are used as the default for all text.\n"
137+
},
138+
{
139+
"name": "headings",
140+
"description": "Settings for headings\n"
141+
},
142+
{
143+
"name": "monospace",
144+
"description": "Settings for monospace text\n"
145+
},
146+
{
147+
"name": "monospace-inline",
148+
"description": "Settings for inline code"
149+
},
150+
{
151+
"name": "monospace-block",
152+
"description": "Settings for code blocks"
153+
},
154+
{
155+
"name": "link",
156+
"description": "Settings for links"
157+
}
158+
]
159+
}
160+
]

docs/reference/metadata/brand.qmd

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: "Brand"
3+
format: html
4+
---
5+
6+
The `brand` option is used to define cross-format branding. You can read more about using [Brand in the Guide](/docs/authoring/brand.qmd).
7+
8+
Set brand options in the `_brand.yml` file:
9+
10+
```{.yaml filename="_brand.yml"}
11+
color:
12+
palette:
13+
blue: "#1c84e5"
14+
foreground: blue
15+
```
16+

docs/reference/reference.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,6 @@
7474
href: metadata/citation.qmd
7575
- text: "Cross-References"
7676
href: metadata/crossref.qmd
77+
- text: "Brand"
78+
href: metadata/brand.qmd
7779

tools/reference.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,48 @@ function writeMetadataTable(name: string, title: string, options: Array<Option>)
330330
const citationOptions = readDefinitionsId("csl-item");
331331
writeMetadataTable("citation", "Citation", citationOptions);
332332

333+
// Brand Page
334+
335+
// Filter `definitions` to items with an id field starting with `brand-`
336+
const brandDefinitions = definitions.filter(item => item.id.startsWith("brand-"));
337+
338+
const brandOptions = readDefinitionsId("brand",{
339+
"meta": "Metadata for a brand, including the brand name and important links. See [Meta](#meta) for more information",
340+
"logo": "Provide definitions and defaults for brand's logo in various formats and sizes. See [Logo](#logo) for more information",
341+
"color": "The brand's custom color palette and theme. See [Color](#color) for more information",
342+
"typography": "Typography definitions for the brand. See [Typography](#typography) for more information",
343+
"defaults": "Default settings"
344+
});
345+
346+
const brandMetadata = [
347+
{
348+
"name": "brand",
349+
"title": "Brand",
350+
"options": brandOptions
351+
},
352+
{
353+
"name": "brand-meta",
354+
"title": "Meta",
355+
"options": readDefinitionsId("brand-meta")
356+
},
357+
{
358+
"name": "brand-logo",
359+
"title": "Logo",
360+
"options": readDefinitionsId("brand-logo")
361+
},
362+
{
363+
"name": "brand-color",
364+
"title": "Color",
365+
"options": readDefinitionsId("brand-color")
366+
},
367+
{
368+
"name": "brand-typography",
369+
"title": "Typography",
370+
"options": readDefinitionsId("brand-typography")
371+
}
372+
]
373+
Deno.writeTextFileSync(`docs/reference/metadata/brand.json`, JSON.stringify(brandMetadata, undefined, 2));
374+
333375
// Crossref Page
334376
const crossrefs = readSchema("document-crossref.yml");
335377
const crossrefOptions = (crossrefs as any[]).find(value => value.name == "crossref")["schema"]["anyOf"][1]["object"]["properties"];

0 commit comments

Comments
 (0)