You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

monaco-vscode-textmate-theme-converter

Package Overview
Dependencies
3
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

monaco-vscode-textmate-theme-converter

Converts VSCode themes to monaco editor themes.


Version published
Maintainers
1
Created

Readme

Source

monaco-vscode-textmate-theme-converter

VSCode themes are directly not compatible with monaco-editor themes. The problem here is that vscode uses tmGrammar tokens for colorization support while monaco uses its own code editor to generate language tokens. (See more about it here).

You can use monaco-textmate to make your monaco-editor tmGrammar compatible.

Once the tokens are tmGrammar compatible, you need to convert vscode generated theme data to monaco-editor compatible api. This package does exactly that.

CLI Usage:

npx monaco-vscode-textmate-theme-converter -i <input-file-or-folder-path> -o <output-file-or-folder-path>

# e.g. convert a single file
# npx monaco-vscode-textmate-theme-converter -i ./vscode-theme.json -o ./monaco-converted-theme.json

# e.g. convert a directory of vscode theme files
# npx monaco-vscode-textmate-theme-converter -i ./vscode-themes -o ./monaco-converted-themes

Programmatic Usage:

import { convertTheme, convertThemeFromDir } from 'monaco-vscode-textmate-theme-converter'; // UMD module
// import { convertTheme, convertThemeFromDir } from 'monaco-vscode-textmate-theme-converter/lib/cjs'; // cjs module

/*
 * In vscode use command: `Developer: Generate Color Theme From Current Settings`
 * Copy the generated JSON and use it as input for the function below.
 */
const theme : IVSCodeTheme = {...}
convertTheme(theme);

/*
 * Convert multiple vscode themes to monaco themes.
 * This function takes as arguments an input directory with generated vscode json files and generated output files with the same names at output directory.
 */
convertThemeFromDir(inputDir: './my-vscode-themes-collection-dir/in', outDir: './my-vscode-themes-collection-dir/out');

Keywords

FAQs

Package last updated on 10 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc