Code Monkey home page Code Monkey logo

code-theme-converter's Introduction

code-theme-converter

CircleCIdownloads npm version

Convert any vscode theme with ease!

I'm mainly working with Visual Studio Code nowadays and also created some themes. There are still some moments, where I prefer to work with other editors like Sublime Text or WebStorm. It bugs me that these editors don't have my vscode themes, so I've created this package to easily convert my themes.

Please use this as a starting point for your theme in Sublime Text 3

Install

Install using npm

npm i -g code-theme-converter

Install using yarn

yarn global add code-theme-converter

Usage

code2subl

code2subl <repo> [options]

Options

  • -S, --save: Install theme into Sublime Text (default: false)
  • -d, --directory: Overwrite directory containing the themes (default: "themes")
  • -T, --as-tm-theme: Convert to .tmTheme instead of .sublime-color-scheme (default: false)
  • -V, --version: Output the version number
  • -h, --help: Output usage information

Example

code2subl https://github.com/tobiastimm/raiju.git

License

MIT

code-theme-converter's People

Contributors

alexisfontaine avatar chtenb avatar dannysummerlin avatar dependabot[bot] avatar tobiastimm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

code-theme-converter's Issues

No such file or directory '/tmp/code-theme-converter/repo/themes'

$ yarn global add code-theme-converter
$ code2subl https://github.com/cue-sh/vscode-cue.git
Fetching repo
Error: ENOENT: no such file or directory, scandir '/tmp/code-theme-converter/repo/themes'
🎉 Successfully converted the vscode theme for sublime text!

code2idea throws `Trace: Error: ENOENT: no such file or directory, scandir`

I tried to convert a VS code repository:


> code2idea https://github.com/enkia/enki-theme.git
Fetching repo
Trace: Error: ENOENT: no such file or directory, scandir 'C:\Users\cyberquarks\AppData\Local\Temp\code-theme-converter\repo\themes'
    at Object.<anonymous> (C:\Users\cyberquarks\AppData\Roaming\npm\node_modules\code-theme-converter\dist\idea\convert.js:88:21)
    at Generator.throw (<anonymous>)
    at rejected (C:\Users\cyberquarks\AppData\Roaming\npm\node_modules\code-theme-converter\dist\idea\convert.js:6:65)
🎉 Successfully converted the vscode theme for IDEA!

Has anyone encountered this issue?

Add UI conversion for Sublime

The UI of a Visual Studio Code theme should be converted properly to Sublime.
As a starting point, all UI themes should be a specialized version of the Adaptive theme

Only single theme is installed in case of multiple themes.

I tried to convert AposTheme which is only available for VS Code to Sublime Text Theme. Apos Theme has 4 colour schemes: Blue, Gray, Red and Green. When I tried the code converter on the following repo: AposTheme, it only converted the last one which is the Red theme. I think it is because of the alphabetical order or an Overwriting Issue which can be solved by giving the file name a number. Thanks!

SyntaxError: JSON5: invalid character '<' at 1:1

I not sure what I am doing wrong but I am getting this error when trying to convert a vscode theme to a sublime theme

The command I enter is: code2subl https://github.com/drywolf/dark-plus-plus-theme
I get the following output:

Fetching repo
Converting 1 theme
🎉 Successfully converted the vscode theme for sublime text!
C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\json5\lib\parse.js:287
        throw invalidChar(read())
        ^

SyntaxError: JSON5: invalid character '<' at 1:1
    at syntaxError (C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\json5\lib\parse.js:1083:17)
    at invalidChar (C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\json5\lib\parse.js:1028:12)
    at Object.value (C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\json5\lib\parse.js:287:15)
    at lex (C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\json5\lib\parse.js:78:42)
    at Object.parse (C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\json5\lib\parse.js:25:17)
    at C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\code-theme-converter\dist\util\vscode.js:54:57
    at C:\Users\MYUSERNAME\scoop\persist\yarn\global\node_modules\graceful-fs\graceful-fs.js:123:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:75:3) {
  lineNumber: 1,
  columnNumber: 1
}

vscode2vim

Is there a way to convert vscode theme to vim?

vscode2vs

As this is a vscode theme converter to other editors I had the idea this might be a nice feature.
Converting vscode themes to visual studio themes.

code2idea and code2subl are not able to checkout the repo

Here is the following error output:

~
❯ code2idea https://github.com/piousdeer/vscode-adwaita.git
Fetching repo
Trace: Error: 'git checkout' failed with status 1
    at Object.<anonymous> (/home/user/.npm/lib/node_modules/code-theme-converter/dist/idea/convert.js:88:21)
    at Generator.throw (<anonymous>)
    at rejected (/home/user/.npm/lib/node_modules/code-theme-converter/dist/idea/convert.js:6:65)
  Successfully converted the vscode theme for IDEA!

Same for code2subl

❯ code2subl "https://github.com/piousdeer/vscode-adwaita"
Fetching repo
Error: 'git checkout' failed with status 1
Successfully converted the vscode theme for sublime text!

Tested against node 18.3.0 and 16.15.1
I have been able to reproduce this behavior in a container as well (node:latest & node:16)

Cannot read property 'id' of undefined on Andromeda theme

Hey, thank you for the hardwork. Wish I could apply Andromeda theme on webstorm

https://github.com/EliverLara/Andromeda

This is the trace

Trace: Error: EEXIST: file already exists, mkdir '/Users/macbook/Downloads/code-theme-converter-master/Andromeda/resources'
    at /Users/macbook/Downloads/code-theme-converter-master/dist/idea/convert.js:81:49
Trace: TypeError: Cannot read property 'id' of undefined
    at /Users/macbook/Downloads/code-theme-converter-master/dist/idea/convert.js:81:49
Trace: TypeError: Cannot read property 'id' of undefined
    at /Users/macbook/Downloads/code-theme-converter-master/dist/idea/convert.js:81:49
Trace: TypeError: Cannot read property 'id' of undefined
    at /Users/macbook/Downloads/code-theme-converter-master/dist/idea/convert.js:81:49
Trace: TypeError: Cannot read property 'id' of undefined
    at /Users/macbook/Downloads/code-theme-converter-master/dist/idea/convert.js:81:49

-T doesn't seem to work

I am using code2subl version 1.2.1 on node 19.8.1 running on macos 13.3.

When I do:

$ code2subl -T https://github.com/tobiastimm/raiju.git

I expect to get some .tmTheme files, instead I get a bunch of .sublime-color-scheme .sublime-theme files.

Any ideas why the -T or --as-tm-theme options seem to be ignored?

List of issues for JetBrains

Do you mind creating a board or issues around JetBrains? That way contributors could see what's in progress or where help is needed?

NPM Package Not Found

When attempting to install via npm install --global --save code-theme-converter per the README, the command fails due to the package not being found. When confirming on the NPM registry, I found that they also show that this package does not exist.

[Question] subl -> vscode?

I'm looking for a tool that could convert .sublime-color-scheme into a VSCode theme. Any ideas?

EDIT: I've since adopted Dracula across all IDEs to remove the need for a converter

TypeError: Cannot read property 'includes' of undefined

code2idea https://github.com/tobiastimm/raiju.git
Fetching repo
Converting 5 themes
🎉 Successfully converted the vscode theme for IDEA!
Converting Raijū (No italics)
Converting Raijū - Dark (No italics)
Converting Raijū - Classic
Converting Raijū
Converting Raijū - Dark
TypeError: Cannot read property 'includes' of undefined

Unable to convert VSCode to sublime as-tm-theme

Trying to convert this Spacemacs theme to tmTheme. It says it succeeds but doesn't make a tmTheme file (does make sublime colorscheme though). I edit the library to make tmTheme default to true and it makes tmTheme file extension but is not tmTheme format.

code2subl https://github.com/cometeer/spacemacs-vscode.git --as-tm-theme

Footnote with orphaned asterisk

In your README you say

*Please use this as a starting point for your theme in Sublime Text 3 or IDEA

But I can't figure out which section you are talking about.

--as-tm-theme or -T option is ignored

I've tried using the --as-tm-theme and -T options. Neither one results in a tmTheme file.

code2subl [email protected]:enkia/tokyo-night-vscode-theme.git --as-tm-theme
Fetching repo
Converting 3 themes
🎉 Successfully converted the vscode theme for sublime text!
Converting Tokyo Night Light
Converting Tokyo Night
Converting Tokyo Night Storm

Results in

ls Tokyo\ Night\ Light/
Tokyo Night Light.sublime-color-scheme  Tokyo Night Light.sublime-theme

No matter what I do. Am I misunderstanding how to use this tool? I expected a .tmTheme instead of .sublime-color-scheme as per the documentation.

SyntaxError: JSON5: invalid character '<' at 1:1

when use code2idea https://github.com/EryouHao/brackets-light-pro.git
i get the following error:

/usr/local/lib/node_modules/code-theme-converter/node_modules/json5/lib/parse.js:287
throw invalidChar(read())
^

SyntaxError: JSON5: invalid character '<' at 1:1
at syntaxError (/usr/local/lib/node_modules/code-theme-converter/node_modules/json5/lib/parse.js:1083:17)
at invalidChar (/usr/local/lib/node_modules/code-theme-converter/node_modules/json5/lib/parse.js:1028:12)
at Object.value (/usr/local/lib/node_modules/code-theme-converter/node_modules/json5/lib/parse.js:287:15)
at lex (/usr/local/lib/node_modules/code-theme-converter/node_modules/json5/lib/parse.js:78:42)
at Object.parse (/usr/local/lib/node_modules/code-theme-converter/node_modules/json5/lib/parse.js:25:17)
at /usr/local/lib/node_modules/code-theme-converter/dist/util/vscode.js:54:57
at /usr/local/lib/node_modules/code-theme-converter/node_modules/graceful-fs/graceful-fs.js:123:16
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:63:3) {
lineNumber: 1,
columnNumber: 1
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.