
Convert a Visual Studio Code or Positron theme into a TextMate theme
Source:R/convert-vs-to-tm.R
convert_vs_to_tm_theme.RdConvert a .json file representing a Visual Studio Code or Positron theme
and write the equivalent TextMate theme (.tmTheme).
convert_positron_to_tm_theme() is an alias of convert_vs_to_tm_theme().
Arguments
- path
Path or URL to a Visual Studio Code or Positron theme, in
.jsonformat.- outfile
Path where the resulting file will be written. By default a temporary file (
tempfile()).- name
Optional. The name of the theme. If not provided, the name of the theme in
pathwill be used.Optional. The author of the theme. If not provided, the author from
pathwill be used or a default value will be assigned.
Value
This function is called for its side effects: it writes a .tmTheme
file to outfile and returns the path.
See also
Other functions for creating themes:
convert_tm_to_vs_theme(),
convert_to_rstudio_theme()
Examples
vstheme <- system.file("ext/test-simple-color-theme.json",
package = "rstudiothemes"
)
path <- convert_vs_to_tm_theme(vstheme)
#> ! Visual Studio Code theme "Skeletor Syntax" does not have an author. Use the `author` argument.
#> ℹ Using `author = "rstudiothemes R package"`.
readLines(path) |>
head(50) |>
cat(sep = "\n")
#> <?xml version="1.0" encoding="UTF-8"?>
#> <plist version="1.0">
#> <dict>
#> <key>name</key>
#> <string>Skeletor Syntax</string>
#> <key>author</key>
#> <string>rstudiothemes R package</string>
#> <key>colorSpaceName</key>
#> <string>sRGB</string>
#> <key>semanticClass</key>
#> <string>theme.dark.skeletor_syntax</string>
#> <key>comment</key>
#> <string>Generated with rstudiothemes R package</string>
#> <key>uuid</key>
#> <string>65623931-3630-4063-b063-653630303437</string>
#> <key>settings</key>
#> <array>
#> <dict>
#> <key>settings</key>
#> <dict>
#> <key>background</key>
#> <string>#2B2836</string>
#> <key>foreground</key>
#> <string>#DCE7FD</string>
#> <key>selection</key>
#> <string>#55535E</string>
#> <key>lineHighlight</key>
#> <string>#55535E</string>
#> <key>caret</key>
#> <string>#BD93F9</string>
#> <key>invisibles</key>
#> <string>#363340</string>
#> <key>gutterForeground</key>
#> <string>#655E7F</string>
#> </dict>
#> </dict>
#> <dict>
#> <key>name</key>
#> <string>comment</string>
#> <key>scope</key>
#> <string>comment</string>
#> <key>settings</key>
#> <dict>
#> <key>foreground</key>
#> <string>#655E7F</string>
#> </dict>
#> </dict>
#> <dict>
#> <key>name</key>
#> <string>doctype</string>