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