|
| 1 | +--- |
| 2 | +title: Theme preview page |
| 3 | +description: |
| 4 | + This is a page used to preview a lot of theme elements in one place. |
| 5 | +displayed_sidebar: toolhiveSidebar |
| 6 | +pagination_next: toolhive/guides-cli/install |
| 7 | +pagination_prev: toolhive/index |
| 8 | +--- |
| 9 | + |
| 10 | +<head> |
| 11 | + <meta name='robots' content='noindex' /> |
| 12 | +</head> |
| 13 | + |
| 14 | +This is a page used to preview a lot of theme elements in one place when working |
| 15 | +on styles. |
| 16 | + |
| 17 | +[Community knowledge base for Docusaurus design tips](https://docusaurus.community/knowledge/design/) |
| 18 | + |
| 19 | +Breadcrumbs above aren't very interesting since this is a top-level page that |
| 20 | +doesn't participate in a sidebar, navigate to a different page to see them. |
| 21 | + |
| 22 | +Another element that can't be easily reproduced here is the DocCardList |
| 23 | +component, but you can see it in action on the |
| 24 | +[ToolHive CLI guides index page](./toolhive/guides-cli). |
| 25 | + |
| 26 | +## Level 2 heading |
| 27 | + |
| 28 | +By default level 2-3 headings generate the TOC on the top right |
| 29 | +([reference](https://docusaurus.io/docs/markdown-features/toc#table-of-contents-heading-level)). |
| 30 | + |
| 31 | +### Level 3 heading |
| 32 | + |
| 33 | +Some text within a section. [Here is a link](/theme-preview.mdx). |
| 34 | + |
| 35 | +And here is some `inline code` to show how it looks, even some |
| 36 | +[`inline code with a link`](/theme-preview.mdx). |
| 37 | + |
| 38 | +#### Level 4 heading |
| 39 | + |
| 40 | +This level won't appear in the TOC by default. |
| 41 | + |
| 42 | +## Code blocks |
| 43 | + |
| 44 | +[Docusaurus reference docs](https://docusaurus.io/docs/markdown-features/code-blocks) |
| 45 | + |
| 46 | +```js title="Some JavaScript with line numbers" showLineNumbers |
| 47 | +console.log('We love marmots.'); |
| 48 | + |
| 49 | +function MarmotsAreGreat(agree) { |
| 50 | + if (agree) { |
| 51 | + // highlight-next-line |
| 52 | + return 'I agree, and this line is highlighted!'; |
| 53 | + } |
| 54 | + |
| 55 | + return 'I am wrong.'; |
| 56 | +} |
| 57 | +``` |
| 58 | + |
| 59 | +```yaml title="some-yaml.yaml" |
| 60 | +--- |
| 61 | +# Sample profile for validating repositories |
| 62 | +version: v1 |
| 63 | +type: profile |
| 64 | +name: acme-github-profile |
| 65 | +display_name: Sample Profile |
| 66 | +alert: 'off' |
| 67 | +remediate: 'off' |
| 68 | +repository: |
| 69 | + - type: allowed_selected_actions |
| 70 | + def: |
| 71 | + github_owned_allowed: true |
| 72 | + verified_allowed: true |
| 73 | + patterns_allowed: [] |
| 74 | +``` |
| 75 | +
|
| 76 | +```json title="Example JSON with highlighted lines" {2,5-7} |
| 77 | +{ |
| 78 | + "key": "String", |
| 79 | + "Number": 1, |
| 80 | + "array": [1, 2, 3], |
| 81 | + "nested": { |
| 82 | + "literals": true |
| 83 | + } |
| 84 | +} |
| 85 | +``` |
| 86 | + |
| 87 | +## Admonitions |
| 88 | + |
| 89 | +These are MDX callouts |
| 90 | +([reference](https://docusaurus.io/docs/markdown-features/admonitions)). |
| 91 | + |
| 92 | +They can be customized in src/css/custom.css like so |
| 93 | +([reference](https://docusaurus.community/knowledge/design/admonitions/#updating-the-css)): |
| 94 | + |
| 95 | +```css |
| 96 | +/* Customize the "Tip" admonition */ |
| 97 | +.alert--success { |
| 98 | + --ifm-alert-background-color: #59cfa8; |
| 99 | + --ifm-alert-background-color-highlight: #00bbbe26; |
| 100 | + --ifm-alert-foreground-color: #002a3e; |
| 101 | + --ifm-alert-border-color: #002a3e; |
| 102 | +} |
| 103 | + |
| 104 | +/* Use a different border color in dark mode */ |
| 105 | +[data-theme='dark'] .alert--success { |
| 106 | + --ifm-alert-border-color: #008385; |
| 107 | +} |
| 108 | +``` |
| 109 | + |
| 110 | +:::note |
| 111 | + |
| 112 | +This is a `note` admonition. Its CSS class is `alert--secondary`. |
| 113 | + |
| 114 | +::: |
| 115 | + |
| 116 | +:::tip |
| 117 | + |
| 118 | +This is a `tip` admonition. Its CSS class is `alert--success`. |
| 119 | + |
| 120 | +::: |
| 121 | + |
| 122 | +:::info |
| 123 | + |
| 124 | +This is an `info` admonition. Its CSS class is `alert--info`. |
| 125 | + |
| 126 | +::: |
| 127 | + |
| 128 | +:::warning |
| 129 | + |
| 130 | +This is a `warning` admonition. Its CSS class is `alert--warning`. |
| 131 | + |
| 132 | +::: |
| 133 | + |
| 134 | +:::danger |
| 135 | + |
| 136 | +This is a `danger` admonition. Its CSS class is `alert--danger`. |
| 137 | + |
| 138 | +::: |
| 139 | + |
| 140 | +:::::info Parent |
| 141 | + |
| 142 | +Admonitions can be nested; example here so we can see how the colors look |
| 143 | +together. |
| 144 | + |
| 145 | +::::danger Child |
| 146 | + |
| 147 | +Child content |
| 148 | + |
| 149 | +:::tip Inception |
| 150 | + |
| 151 | +This is getting silly |
| 152 | + |
| 153 | +::: |
| 154 | + |
| 155 | +:::: |
| 156 | + |
| 157 | +::::: |
| 158 | + |
| 159 | +## Tables |
| 160 | + |
| 161 | +A standard Markdown table: |
| 162 | + |
| 163 | +| Column 1 | Column 2 | Column 3 | |
| 164 | +| --------------- | :---------: | ---------------------------- | |
| 165 | +| This | hello | [A link in a table](#tables) | |
| 166 | +| That | hi | `value` | |
| 167 | +| The other thing | how are you | 🙈 | |
| 168 | +| Another row | so you | can see the zebra effect | |
| 169 | + |
| 170 | +(Docusaurus theme enables header row and zebra rows by default) |
| 171 | + |
| 172 | +## Tabs |
| 173 | + |
| 174 | +MDX Tabs component, default theme |
| 175 | +([reference](https://docusaurus.io/docs/markdown-features/tabs)) |
| 176 | + |
| 177 | +import Tabs from '@theme/Tabs'; |
| 178 | +import TabItem from '@theme/TabItem'; |
| 179 | + |
| 180 | +<Tabs> |
| 181 | + <TabItem value='apple' label='Apple' default> |
| 182 | + This is an apple 🍎 |
| 183 | + |
| 184 | + ```python title="Code block inside a tab" |
| 185 | + print('We love marmots.') |
| 186 | + |
| 187 | + def marmots_are_great(agree): |
| 188 | + if agree: |
| 189 | + # highlight-next-line |
| 190 | + return 'I agree, and this line is highlighted!' |
| 191 | + |
| 192 | + return 'I am wrong.' |
| 193 | + ``` |
| 194 | + |
| 195 | + </TabItem> |
| 196 | + <TabItem value='orange' label='Orange'> |
| 197 | + This is an orange 🍊 |
| 198 | + </TabItem> |
| 199 | + <TabItem value='banana' label='Banana'> |
| 200 | + This is a banana 🍌 |
| 201 | + </TabItem> |
| 202 | +</Tabs> |
| 203 | + |
| 204 | +## Details panel |
| 205 | + |
| 206 | +<details> |
| 207 | + <summary>Click to expand</summary> |
| 208 | + |
| 209 | +This is a details panel, which can be used to show additional information |
| 210 | +without cluttering the page. |
| 211 | + |
| 212 | +It can contain any Markdown or MDX content, including `inline code`, code |
| 213 | +blocks, images, even other details panels. |
| 214 | + |
| 215 | +```js title="JavaScript code inside a details panel" |
| 216 | +console.log('This is inside a details panel.'); |
| 217 | +``` |
| 218 | + |
| 219 | +</details> |
| 220 | + |
| 221 | +## Images |
| 222 | + |
| 223 | +An MDX ThemedImage, which switches based on light/dark theme |
| 224 | +([reference](https://docusaurus.io/docs/markdown-features/assets#themed-images)) |
| 225 | + |
| 226 | +import useBaseUrl from '@docusaurus/useBaseUrl'; |
| 227 | +import ThemedImage from '@theme/ThemedImage'; |
| 228 | + |
| 229 | +<ThemedImage |
| 230 | + alt='Docusaurus themed image' |
| 231 | + width='300px' |
| 232 | + sources={{ |
| 233 | + light: useBaseUrl('/img/stacklok-wordmark-black.svg'), |
| 234 | + dark: useBaseUrl('/img/stacklok-wordmark-white.svg'), |
| 235 | + }} |
| 236 | +/> |
| 237 | + |
| 238 | +An image using the "screenshot" CSS class to add a border and shadow/glow to |
| 239 | +make them stand out from the background: |
| 240 | + |
| 241 | +<ThemedImage |
| 242 | + alt='VS Code MCP settings' |
| 243 | + sources={{ |
| 244 | + light: useBaseUrl('/img/toolhive/quickstart/vscode-mcp-start-light.webp'), |
| 245 | + dark: useBaseUrl('/img/toolhive/quickstart/vscode-mcp-start-dark.webp'), |
| 246 | + }} |
| 247 | + title='VS Code MCP settings' |
| 248 | + width='450' |
| 249 | + className='screenshot' |
| 250 | +/> |
| 251 | + |
| 252 | +## Diagrams |
| 253 | + |
| 254 | +A mermaid flowchart |
| 255 | +([reference](https://docusaurus.io/docs/markdown-features/diagrams)) |
| 256 | + |
| 257 | +```mermaid |
| 258 | +flowchart LR |
| 259 | + node1["Node"] -- Label --> node2 |
| 260 | + node2["Node"] -- Label --> node3 |
| 261 | + subgraph container["**Subgraph**"] |
| 262 | + direction LR |
| 263 | + subgraph container1["Nested subgraph"] |
| 264 | + node3["Node"] |
| 265 | + end |
| 266 | + end |
| 267 | +``` |
| 268 | + |
| 269 | +A mermaid sequence diagram |
| 270 | + |
| 271 | +```mermaid |
| 272 | +sequenceDiagram |
| 273 | + Alice->>+John: Hello John, how are you? |
| 274 | + note right of John: Note |
| 275 | + John-->>-Alice: Great! |
| 276 | + Alice-)John: See you later! |
| 277 | +``` |
| 278 | + |
| 279 | +## Other standard elements |
| 280 | + |
| 281 | +Here's some **bold** and _italic_ text. |
| 282 | + |
| 283 | +Unordered list: |
| 284 | + |
| 285 | +- One |
| 286 | +- Two |
| 287 | +- Three |
| 288 | + |
| 289 | +Ordered list: |
| 290 | + |
| 291 | +1. One |
| 292 | +1. Two |
| 293 | +1. Three |
| 294 | + |
| 295 | +Horizontal line: |
| 296 | + |
| 297 | +--- |
| 298 | + |
| 299 | +## Pagination |
0 commit comments