refactor: simplified extra template system and added docs
This commit is contained in:
@@ -2,11 +2,8 @@ local util = require("tokyonight.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.alacritty(config)
|
||||
config = config or require("tokyonight.config")
|
||||
config.transform_colors = true
|
||||
local colors = require("tokyonight.colors").setup(config)
|
||||
|
||||
--- @param colors ColorScheme
|
||||
function M.generate(colors)
|
||||
local alacrittyColors = {}
|
||||
for k, v in pairs(colors) do
|
||||
if type(v) == "string" then
|
||||
|
||||
@@ -2,11 +2,8 @@ local util = require("tokyonight.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.fish(config)
|
||||
config = config or require("tokyonight.config")
|
||||
config.transform_colors = true
|
||||
local colors = require("tokyonight.colors").setup(config)
|
||||
|
||||
--- @param colors ColorScheme
|
||||
function M.generate(colors)
|
||||
local fishColors = {}
|
||||
for k, v in pairs(colors) do
|
||||
if type(v) == "string" then
|
||||
|
||||
@@ -9,6 +9,7 @@ local function write(str, fileName)
|
||||
file:close()
|
||||
end
|
||||
|
||||
-- map of plugin name to plugin extension
|
||||
local extras = { kitty = "conf", fish = "fish", alacritty = "yml", wezterm = "toml", tmux = "tmux" }
|
||||
local styles = { "storm", "night", "day" }
|
||||
|
||||
@@ -16,6 +17,9 @@ for extra, ext in pairs(extras) do
|
||||
local plugin = require("tokyonight.extra." .. extra)
|
||||
for _, style in pairs(styles) do
|
||||
config.style = style
|
||||
write(plugin[extra](config), extra .. "_tokyonight_" .. style .. "." .. ext)
|
||||
config = config or require("tokyonight.config")
|
||||
config.transform_colors = true
|
||||
local colors = require("tokyonight.colors").setup(config)
|
||||
write(plugin.generate(colors), extra .. "_tokyonight_" .. style .. "." .. ext)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,11 +2,8 @@ local util = require("tokyonight.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.kitty(config)
|
||||
config = config or require("tokyonight.config")
|
||||
config.transform_colors = true
|
||||
local colors = require("tokyonight.colors").setup(config)
|
||||
|
||||
--- @param colors ColorScheme
|
||||
function M.generate(colors)
|
||||
local kitty = util.template(
|
||||
[[
|
||||
# TokyoNight colors for Kitty
|
||||
|
||||
@@ -2,11 +2,8 @@ local util = require("tokyonight.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.tmux(config)
|
||||
config = config or require("tokyonight.config")
|
||||
config.transform_colors = true
|
||||
local colors = require("tokyonight.colors").setup(config)
|
||||
|
||||
--- @param colors ColorScheme
|
||||
function M.generate(colors)
|
||||
local tmux = util.template(
|
||||
[[
|
||||
#!/usr/bin/env bash
|
||||
|
||||
@@ -2,11 +2,8 @@ local util = require("tokyonight.util")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.wezterm(config)
|
||||
config = config or require("tokyonight.config")
|
||||
config.transform_colors = true
|
||||
local colors = require("tokyonight.colors").setup(config)
|
||||
|
||||
--- @param colors ColorScheme
|
||||
function M.generate(colors)
|
||||
local kitty = util.template(
|
||||
[[
|
||||
[colors]
|
||||
|
||||
Reference in New Issue
Block a user