mirror of
https://github.com/microsoft/monaco-editor.git
synced 2025-12-22 16:15:41 +01:00
Also generate README default values
This commit is contained in:
parent
00036c08f3
commit
4ec9d1e432
2 changed files with 25 additions and 7 deletions
|
|
@ -51,7 +51,7 @@ Options can be passed in to `MonacoWebpackPlugin`. They can be used to generate
|
|||
* `publicPath` (`string`) - custom public path for worker scripts, overrides 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..
|
||||
* default value: `''`.
|
||||
* `languages` (`string[]`) - include only a subset of the languages supported.
|
||||
* default value: <!-- LANGUAGES_BEGIN -->`['apex', 'azcli', 'bat', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dockerfile', 'fsharp', 'go', 'handlebars', 'html', 'ini', 'java', 'javascript', 'json', 'less', 'lua', 'markdown', 'msdax', 'mysql', 'objective', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'r', 'razor', 'redis', 'redshift', 'ruby', 'rust', 'sb', 'scheme', 'scss', 'shell', 'solidity', 'sql', 'st', 'swift', 'typescript', 'vb', 'xml', 'yaml']`<!-- LANGUAGES_END -->.
|
||||
* default value: <!-- LANGUAGES_BEGIN -->`['abap', 'apex', 'azcli', 'bat', 'clojure', 'coffee', 'cpp', 'csharp', 'csp', 'css', 'dockerfile', 'fsharp', 'go', 'graphql', 'handlebars', 'html', 'ini', 'java', 'javascript', 'json', 'kotlin', 'less', 'lua', 'markdown', 'mips', 'msdax', 'mysql', 'objective-c', 'pascal', 'pascaligo', 'perl', 'pgsql', 'php', 'postiats', 'powerquery', 'powershell', 'pug', 'python', 'r', 'razor', 'redis', 'redshift', 'ruby', 'rust', 'sb', 'scheme', 'scss', 'shell', 'solidity', 'sophia', 'sql', 'st', 'swift', 'tcl', 'twig', 'typescript', 'vb', 'xml', 'yaml']`<!-- LANGUAGES_END -->.
|
||||
|
||||
Some languages share the same web worker. If one of the following languages is included, you must also include the language responsible for instantiating their shared worker:
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ Options can be passed in to `MonacoWebpackPlugin`. They can be used to generate
|
|||
|
||||
|
||||
* `features` (`string[]`) - include only a subset of the editor features.
|
||||
* default value: <!-- FEATURES_BEGIN -->`['accessibilityHelp', 'bracketMatching', 'caretOperations', 'clipboard', 'codeAction', 'codelens', 'colorDetector', 'comment', 'contextmenu', 'coreCommands', 'cursorUndo', 'dnd', 'find', 'folding', 'fontZoom', 'format', 'goToDefinitionCommands', 'goToDefinitionMouse', 'gotoError', 'gotoLine', 'hover', 'inPlaceReplace', 'inspectTokens', 'iPadShowKeyboard', 'linesOperations', 'links', 'multicursor', 'parameterHints', 'quickCommand', 'quickOutline', 'referenceSearch', 'rename', 'smartSelect', 'snippets', 'suggest', 'toggleHighContrast', 'toggleTabFocusMode', 'transpose', 'wordHighlighter', 'wordOperations', 'wordPartOperations']`<!-- FEATURES_END -->.
|
||||
* default value: <!-- FEATURES_BEGIN -->`['accessibilityHelp', 'bracketMatching', 'caretOperations', 'clipboard', 'codeAction', 'codelens', 'colorDetector', 'comment', 'contextmenu', 'coreCommands', 'cursorUndo', 'dnd', 'find', 'folding', 'fontZoom', 'format', 'goToDefinitionCommands', 'goToDefinitionMouse', 'gotoError', 'gotoLine', 'hover', 'iPadShowKeyboard', 'inPlaceReplace', 'inspectTokens', 'linesOperations', 'links', 'multicursor', 'parameterHints', 'quickCommand', 'quickOutline', 'referenceSearch', 'rename', 'smartSelect', 'snippets', 'suggest', 'toggleHighContrast', 'toggleTabFocusMode', 'transpose', 'wordHighlighter', 'wordOperations', 'wordPartOperations']`<!-- FEATURES_END -->.
|
||||
* excluded features: It is also possible to exclude certain default features prefixing them with an exclamation mark '!'.
|
||||
|
||||
## Contributing
|
||||
|
|
|
|||
|
|
@ -155,10 +155,19 @@ export const languagesArr: IFeatureDefinition[] = ${
|
|||
|
||||
export type EditorLanguage = ${
|
||||
result.map(el => `'${el.label}'`).join(' | ')
|
||||
};
|
||||
};
|
||||
|
||||
`
|
||||
fs.writeFileSync(path.join(__dirname, '../src/languages.ts'), code.replace(/\r\n/g, '\n'));
|
||||
|
||||
const readmeLanguages = (
|
||||
JSON.stringify(result.map(r => r.label))
|
||||
.replace(/"/g, '\'')
|
||||
.replace(/','/g, '\', \'')
|
||||
);
|
||||
let readme = fs.readFileSync(path.join(__dirname, '../README.md')).toString();
|
||||
readme = readme.replace(/<!-- LANGUAGES_BEGIN -->([^<]+)<!-- LANGUAGES_END -->/, `<!-- LANGUAGES_BEGIN -->\`${readmeLanguages}\`<!-- LANGUAGES_END -->`);
|
||||
fs.writeFileSync(path.join(__dirname, '../README.md'), readme);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -240,11 +249,20 @@ export const featuresArr: IFeatureDefinition[] = ${
|
|||
|
||||
export type EditorFeature = ${
|
||||
result.map(el => `'${el.label}'`).join(' | ')
|
||||
};
|
||||
};
|
||||
|
||||
export type NegatedEditorFeature = ${
|
||||
result.map(el => `'!${el.label}'`).join(' | ')
|
||||
};
|
||||
};
|
||||
`
|
||||
fs.writeFileSync(path.join(__dirname, '../src/features.ts'), code.replace(/\r\n/g, '\n'));
|
||||
|
||||
const readmeFeatures = (
|
||||
JSON.stringify(result.map(r => r.label))
|
||||
.replace(/"/g, '\'')
|
||||
.replace(/','/g, '\', \'')
|
||||
);
|
||||
let readme = fs.readFileSync(path.join(__dirname, '../README.md')).toString();
|
||||
readme = readme.replace(/<!-- FEATURES_BEGIN -->([^<]+)<!-- FEATURES_END -->/, `<!-- FEATURES_BEGIN -->\`${readmeFeatures}\`<!-- FEATURES_END -->`);
|
||||
fs.writeFileSync(path.join(__dirname, '../README.md'), readme);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue