Skip to main content

⚙️ Theme Configuration

Configuration

NameTypeDefaultDescription
monacoConfigMonacoConfig{ "languages": ["json"] }To customize monaco editor, depending of your needs.

Types

type MonacoConfig = {
// More info on https://github.com/microsoft/monaco-editor/tree/main/webpack-plugin#options
/**
* Include only a subset of the languages supported.
* @default ["json"]
*/
languages?: EditorLanguage[]
/**
* Custom languages (outside of the ones shipped with the `monaco-editor`).
*/
customLanguages?: IFeatureDefinition[]
/**
* Include only a subset of the editor features.
* Use e.g. '!contextmenu' to exclude a certain feature.
* (By default, all features are enabled)
*/
features?: (EditorFeature | NegatedEditorFeature)[]
/**
* Specify a filename template to use for generated files.
* Use e.g. '[name].worker.[contenthash].js' to include content-based hashes.
*/
filename?: string
/**
* The absolute file system path to the monaco-editor npm module.
* Use e.g. `C:\projects\my-project\node-modules\monaco-editor`
*/
monacoEditorPath?: string
/**
* Override the public path from which files generated by this plugin will be served.
* This wins out over Webpack's dynamic runtime path and can be useful to avoid attempting to load workers cross-
* origin when using a CDN for other static resources.
* Use e.g. '/' if you want to load your resources from the current origin.
*/
publicPath?: string
/**
* Specify whether the editor API should be exposed through a global `monaco` object or not. This
* option is applicable to `0.22.0` and newer version of `monaco-editor`. Since `0.22.0`, the ESM
* version of the monaco editor does no longer define a global `monaco` object unless
* `global.MonacoEnvironment = { globalAPI: true }` is set
* @see https://github.com/microsoft/monaco-editor/blob/main/CHANGELOG.md#0220-29012021
*/
globalAPI?: boolean
}

Example configuration

docusaurus.config.js
module.exports = {
themes: [
[
'docusaurus-json-schema-plugin',
{
monacoConfig: {
languages: ["json"]
}
},
],
],
};

// Example : https://lars-waechter.gitbook.io/voici.js/reference/api-reference/accumulation