cloudflare-docs/plugins/expressive-code/default-titles.js
Kian a1bf485920
[Docs Site] Adopt eslint (#19263)
* [Docs Site] Adopt eslint

* Demonstrate a fixable suggestion, add VSCode plugin and package.json script

* Fix slice in ModelCatalog

* Remove test error in AnchorHeading

* recreate package-lock.json

* update new .jsx components to .tsx

* amend deps, fix react types, organise ec plugins

* another attempt at fixing platform-specific deps

* fix FieldCatalog filters, remove test block from code.mdx

* use opacity instead of brightness for ruleid

* fix lockfile

* amend ruleid opacity styling

* test onetrust

* enable prefer const rule, remove onetrust test

* add save-dev
2025-01-21 18:28:16 +00:00

20 lines
410 B
JavaScript

import { definePlugin } from "@expressive-code/core";
export default () => {
return definePlugin({
name: "Adds language-specific default titles.",
hooks: {
preprocessLanguage: async (context) => {
switch (context.codeBlock.language) {
case "powershell": {
context.codeBlock.props.title ??= "PowerShell";
break;
}
default: {
return;
}
}
},
},
});
};