Skip to content

Commit cb25576

Browse files
committed
[Docs Site] Add collapsible plugin to code blocks
1 parent b7e361e commit cb25576

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed

ec.config.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import lightTheme from "solarflare-theme/themes/cloudflare-light-color-theme.jso
55
import { definePlugin } from "@expressive-code/core";
66
import { h } from "@expressive-code/core/hast";
77

8+
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
9+
810
import lzstring from "lz-string";
911

1012
/**
@@ -156,6 +158,7 @@ export default {
156158
workersPlaygroundButton(),
157159
outputCodeblocks(),
158160
defaultLanguageTitles(),
161+
pluginCollapsibleSections(),
159162
],
160163
themes: [darkTheme, lightTheme],
161164
styleOverrides: {

package-lock.json

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

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"@cloudflare/vitest-pool-workers": "^0.5.40",
3838
"@cloudflare/workers-types": "^4.20241218.0",
3939
"@codingheads/sticky-header": "^1.0.2",
40+
"@expressive-code/plugin-collapsible-sections": "^0.38.3",
4041
"@iarna/toml": "^2.2.5",
4142
"@iconify-json/material-symbols": "^1.2.12",
4243
"@stoplight/json-schema-tree": "^4.0.0",

src/content/docs/style-guide/components/code.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,15 @@ This is just a small showcase of functionality, it has a lot of options!
1010
Write-Output "This one has a title!"
1111
```
1212

13+
```js collapse={3-5}
14+
// Collapsing
15+
const foo = {
16+
1: 1,
17+
2: 2,
18+
3: 3,
19+
};
20+
```
21+
1322
```js wrap
1423
// Example with wrap
1524
function getLongString() {

0 commit comments

Comments
 (0)