You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -28,10 +29,6 @@ Code blocks in Markdown are fenced by three beginning and ending backticks (` ``
28
29
29
30
Hovering over a Starlight code block will display a copy button.
30
31
31
-
:::note
32
-
As of November 29, 2023, this button will not appear when using the in-house [ChunkedSnippet](/oppm/chunkedsnippet) component. We're tracking the issue in https://github.com/interledger/open-payments/issues/384.
33
-
:::
34
-
35
32
#### Syntax highlighting
36
33
37
34
You can indicate the programming language to use if you want to use syntax highlighting. Astro uses [Shiki](https://shiki.style/languages), so check their documentation if you aren't sure if your language is supported.
@@ -48,7 +45,7 @@ This code block has a title! HJ made the component. Isn't she neat?
48
45
49
46
</CodeBlock>
50
47
51
-
As of November 2023, Starlight now supports adding titles to code blocks; however, the title is styled to appear in a tab. Also, to use the Starlight title, you **must** specify a programming language.
48
+
As of November 2023, Starlight now supports adding titles to code blocks, but the title is styled to appear in a tab. Also, to use the Starlight title, you **must** specify a programming language.
52
49
53
50
We've chosen to keep our in-house `CodeBlock` component because we like the style more. However, you are free to use the Starlight defaults if they fit better with what you're documenting.
54
51
@@ -62,7 +59,7 @@ I mean, at least it works by default now, right?
62
59
```
63
60
````
64
61
65
-
By default, a Starlight code block will be rendered as a terminal window if a shell scripting language is used (e.g., `bash`, `shell`, `zsh`). Titles are styled differently in this context.
62
+
By default, a Starlight code block will be rendered as a terminal window if a shell scripting language is used (for example, `bash`, `shell`, `zsh`). Titles are styled differently in this context.
66
63
67
64
For example:
68
65
@@ -73,19 +70,54 @@ See what it looks like?
73
70
See the [Frames and titles](https://starlight.astro.build/guides/authoring-content/#frames-and-titles) section in Starlight's docs for more information.
74
71
75
72
### Tabs
76
-
<p>
77
-
<mark>*This section needs to be added, along with info about tab synching.*</mark>
78
-
</p>
73
+
74
+
You can keep multiple tab groups in a page synchronized by using `syncKey`.
75
+
76
+
All tabs on a page with the same `syncKey` value will display the same active label. This is especially helpful when documenting programming languages. Note that the synching only persists on the page, not across pages.
77
+
78
+
Add an identical `syncKey` property to each `<TabItem>`.
79
+
80
+
```js {1, 8}
81
+
<Tabs syncKey="constellations">
82
+
<TabItem label="Orion">Bellatrix</TabItem>
83
+
<TabItem label="Gemini">Pollux</TabItem>
84
+
</Tabs>
85
+
86
+
_Some exoplanets:_
87
+
88
+
<Tabs syncKey="constellations">
89
+
<TabItem label="Orion">HD34445 b</TabItem>
90
+
<TabItem label="Gemini">Pollux b</TabItem>
91
+
</Tabs>
92
+
```
93
+
94
+
#### Example
95
+
96
+
<Tabs syncKey="constellations">
97
+
<TabItem label="Orion">Bellatrix</TabItem>
98
+
<TabItem label="Gemini">Pollux</TabItem>
99
+
</Tabs>
100
+
101
+
<hr />
102
+
103
+
<Tabs syncKey="constellations">
104
+
<TabItem label="Orion">HD 34445 b</TabItem>
105
+
<TabItem label="Gemini">Pollux b</TabItem>
106
+
</Tabs>
107
+
108
+
:::note
109
+
You can also [add icons](https://starlight.astro.build/components/tabs/#add-icons-to-tabs) to the tabs, but as of June 2025, you're limited to Starlight's [built-in icons](https://starlight.astro.build/reference/icons/#all-icons).
110
+
:::
79
111
80
112
## Misc
81
113
82
114
### Style a single page with CSS
83
115
84
116
If there's a style you need to apply to an entire page, to every instance of an element, you can do so in the frontmatter.
85
117
86
-
For example, the tables in the [Sequence diagram style guide](/content/sequence-diagrams) were behaving poorly. Text aligned itself to `baseline` which pushed the content in the last row outside of the table's bounds. Also, some code that needed to appear on a single line was breaking.
118
+
For example, the tables in the [Sequence diagram style guide](/content/sequence-diagrams) were behaving poorly. Text aligned itself to `baseline` which pushed the content in the last row outside the table's bounds. Also, some code that needed to appear on a single line was breaking.
87
119
88
-
Instead of adding styles within each table in the page, the styles were applied to the page itself like so:
120
+
Instead of adding styles in each table in the page, the styles were applied to the page itself like so:
0 commit comments