mirror of
https://github.com/cloudflare/cloudflare-docs.git
synced 2026-01-11 20:06:58 +00:00
[Docs Site] Add EC line numbers plugin (#23667)
This commit is contained in:
parent
2c4a8818ea
commit
8fd6c1660b
4 changed files with 23 additions and 0 deletions
|
|
@ -10,6 +10,7 @@ import pluginDefaultTitles from "./src/plugins/expressive-code/default-titles.js
|
|||
import pluginGraphqlApiExplorer from "./src/plugins/expressive-code/graphql-api-explorer.js";
|
||||
|
||||
import { pluginCollapsibleSections } from "@expressive-code/plugin-collapsible-sections";
|
||||
import { pluginLineNumbers } from "@expressive-code/plugin-line-numbers";
|
||||
|
||||
export default defineEcConfig({
|
||||
plugins: [
|
||||
|
|
@ -18,7 +19,11 @@ export default defineEcConfig({
|
|||
pluginDefaultTitles(),
|
||||
pluginCollapsibleSections(),
|
||||
pluginGraphqlApiExplorer(),
|
||||
pluginLineNumbers(),
|
||||
],
|
||||
defaultProps: {
|
||||
showLineNumbers: false,
|
||||
},
|
||||
themes: [darkTheme, lightTheme],
|
||||
styleOverrides: {
|
||||
borderWidth: "1px",
|
||||
|
|
|
|||
11
package-lock.json
generated
11
package-lock.json
generated
|
|
@ -21,6 +21,7 @@
|
|||
"@cloudflare/workers-types": "4.20250711.0",
|
||||
"@codingheads/sticky-header": "1.0.2",
|
||||
"@expressive-code/plugin-collapsible-sections": "0.41.3",
|
||||
"@expressive-code/plugin-line-numbers": "0.41.3",
|
||||
"@floating-ui/react": "0.27.13",
|
||||
"@iarna/toml": "2.2.5",
|
||||
"@lottiefiles/dotlottie-react": "0.14.2",
|
||||
|
|
@ -3587,6 +3588,16 @@
|
|||
"@expressive-code/core": "^0.41.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@expressive-code/plugin-line-numbers": {
|
||||
"version": "0.41.3",
|
||||
"resolved": "https://registry.npmjs.org/@expressive-code/plugin-line-numbers/-/plugin-line-numbers-0.41.3.tgz",
|
||||
"integrity": "sha512-eig82a4CRC3XgVPQ2S/TMDcLiHJokOCD/mAdNVImpD3segVewxfjGgtj5DXQRo0E0q6f0R0EH34YzTFl5CEPqg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@expressive-code/core": "^0.41.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@expressive-code/plugin-shiki": {
|
||||
"version": "0.41.2",
|
||||
"resolved": "https://registry.npmjs.org/@expressive-code/plugin-shiki/-/plugin-shiki-0.41.2.tgz",
|
||||
|
|
|
|||
|
|
@ -39,6 +39,7 @@
|
|||
"@cloudflare/workers-types": "4.20250711.0",
|
||||
"@codingheads/sticky-header": "1.0.2",
|
||||
"@expressive-code/plugin-collapsible-sections": "0.41.3",
|
||||
"@expressive-code/plugin-line-numbers": "0.41.3",
|
||||
"@floating-ui/react": "0.27.13",
|
||||
"@iarna/toml": "2.2.5",
|
||||
"@lottiefiles/dotlottie-react": "0.14.2",
|
||||
|
|
|
|||
|
|
@ -21,6 +21,12 @@ const foo = {
|
|||
};
|
||||
```
|
||||
|
||||
```js showLineNumbers
|
||||
// Line numbers
|
||||
const foo = "bar";
|
||||
const bar = "baz";
|
||||
```
|
||||
|
||||
```js wrap
|
||||
// Example with wrap
|
||||
function getLongString() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue