mirror of
https://github.com/cloudflare/cloudflare-docs.git
synced 2026-01-11 20:06:58 +00:00
* [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
20 lines
410 B
JavaScript
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;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
});
|
|
};
|