modify build script for zenflesh

This commit is contained in:
Michael Chris Lopez
2021-09-14 05:53:51 +08:00
parent b5d0803c53
commit 87bd1e39fa
8 changed files with 143 additions and 125 deletions

View File

@@ -1,6 +1,4 @@
local lush = require "lush"
local theme = require "zenbones"
local terminal = require "zenbones.terminal"
local template = [[if exists('g:colors_name')
highlight clear
@@ -9,7 +7,7 @@ local template = [[if exists('g:colors_name')
endif
set background=light
let g:colors_name = 'zenbones'
let g:colors_name = '${name}'
${termcolors}
if has('terminal')
@@ -36,19 +34,24 @@ endif
${vimcolors}
]]
local termcolors = ""
for i, v in ipairs(terminal.colors) do
termcolors = termcolors .. string.format("let g:terminal_color_%s = '%s'\n", (i - 1), v.hex)
return function(name)
local theme = require(name)
local terminal = require(name .. ".terminal")
local termcolors = ""
for i, v in ipairs(terminal.colors) do
termcolors = termcolors .. string.format("let g:terminal_color_%s = '%s'\n", (i - 1), v.hex)
end
-- Compile lush table, concatenate to a single string, and remove blend property
local vimcolors = table.concat(vim.fn.sort(lush.compile(theme, { exclude_keys = { "blend" } })), "\n")
return {
string.format("colors/%s.vim", name),
template,
{
name = name,
termcolors = termcolors,
vimcolors = vimcolors,
},
}
end
-- Compile lush table, concatenate to a single string, and remove blend property
local vimcolors = table.concat(vim.fn.sort(lush.compile(theme, { exclude_keys = { "blend" } })), "\n")
return {
"colors/zenbones.vim",
template,
{
termcolors = termcolors,
vimcolors = vimcolors,
},
}