Skip to content

Commit 2f5522b

Browse files
DOD-1015-pebbles
andauthored
feat(platforms): add generation for platform files (#161)
Co-authored-by: Owen Friedman <5-pebble@protonmail.com>
1 parent 082b61f commit 2f5522b

23 files changed

Lines changed: 1394 additions & 559 deletions

File tree

.github/workflows/docs_and_format.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
1-
name: Generate docs and format
1+
name: Generate docs, format and platforms
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66

77
jobs:
8-
98
docs-and-fmt:
109
if: github.event != 'pull_request'
1110
name: Generate docs and format
@@ -44,3 +43,6 @@ jobs:
4443
commit_user_email: "github-actions[bot]@users.noreply.github.com"
4544
commit_author: "github-actions[bot] <github-actions[bot]@users.noreply.github.com>"
4645
branch: ${{ github.head_ref }}
46+
47+
- name: Generate platform files
48+
run: "./platforms.sh"

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,12 @@ require('nordic').setup({
213213

214214
For the list of supported plugins, please take a look at [this file](https://github.com/AlexvZyl/nordic.nvim/blob/main/lua/nordic/groups/integrations.lua). For the list of supported platforms, please take a look at [this directory](https://github.com/AlexvZyl/nordic.nvim/tree/main/platforms).
215215

216-
I do not personally use all of the platforms and plugins in the list, so if something is not right, or you have a suggestion, please open a PR!
216+
## Contributing a new Platform
217+
218+
All of the platform files are generated using a template system. Have a look at [this directory](https://github.com/AlexvZyl/nordic.nvim/tree/main/lua/nordic/platforms) to see how it works.
219+
220+
> [!NOTE]
221+
> I don't personally use all of the platforms and plugins in the list, so if something is not right, or you have a suggestion, please open a PR!
217222
218223
# 🎙️ Acknowledgements
219224

lua/nordic/platforms/fish.lua

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
local U = require('nordic.utils')
2+
3+
local M = {}
4+
5+
function M.generate(colors)
6+
local fishColors = U.removeHash(colors)
7+
8+
return U.template(
9+
[[
10+
# Name: Nordic
11+
# Auother: XXiaoA
12+
# https://fishshell.com/docs/current/interactive.html#syntax-highlighting-variables
13+
14+
# Syntax Highlighting Colors
15+
fish_color_normal ${blue1}
16+
fish_color_command ${yellow.base}
17+
fish_color_keyword ${magenta.base}
18+
fish_color_quote ${green.base}
19+
fish_color_redirection ${white1}
20+
fish_color_end ${white0_normal}
21+
fish_color_error ${error}
22+
fish_color_param ${blue2}
23+
fish_color_comment ${gray4}
24+
fish_color_selection --background=${gray2}
25+
fish_color_search_match --background=${black1}
26+
fish_color_operator ${orange.base}
27+
fish_color_escape ${blue1}
28+
fish_color_autosuggestion ${gray5}
29+
30+
# Completion Pager Colors
31+
fish_pager_color_progress ${blue1}
32+
fish_pager_color_prefix ${yellow.base}
33+
fish_pager_color_completion ${white1}
34+
fish_pager_color_description ${blue1}
35+
fish_pager_color_selected_background --background=${gray2}
36+
]],
37+
fishColors
38+
)
39+
end
40+
41+
return M

lua/nordic/platforms/foot.lua

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
local U = require('nordic.utils')
2+
3+
local M = {}
4+
5+
function M.generate(colors)
6+
local footColors = U.removeHash(colors)
7+
8+
return U.template(
9+
[[
10+
[colors]
11+
foreground=${fg}
12+
background=${bg}
13+
14+
# black
15+
regular0=${black0}
16+
bright0=${gray2}
17+
18+
# red
19+
regular1=${red.base}
20+
bright1=${red.bright}
21+
22+
# green
23+
regular2=${green.base}
24+
bright2=${green.bright}
25+
26+
# yellow
27+
regular3=${yellow.base}
28+
bright3=${yellow.bright}
29+
30+
# blue
31+
regular4=${blue0}
32+
bright4=${blue2}
33+
34+
# magenta
35+
regular5=${magenta.base}
36+
bright5=${magenta.bright}
37+
38+
# cyan
39+
regular6=${cyan.base}
40+
bright6=${cyan.bright}
41+
42+
# white
43+
regular7=${white0}
44+
bright7=${white1}
45+
]],
46+
footColors
47+
)
48+
end
49+
50+
return M

lua/nordic/platforms/ghostty.lua

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
local U = require('nordic.utils')
2+
3+
local M = {}
4+
5+
function M.generate(colors)
6+
return U.template(
7+
[[
8+
# Nordic Colorscheme for Ghostty.
9+
# Based on https://github.com/AlexvZyl/nordic.nvim
10+
# Author: @jorgebef
11+
12+
# To use this theme you have 2 options to install it:
13+
#
14+
# - Clone the theme file and set the theme option in your config to the absolute path of the theme file.
15+
# Example:
16+
#
17+
# ```ini
18+
# theme = "/home/jbef/.config/ghostty/nordic"
19+
# ```
20+
#
21+
# - Copy the code directly inside your `ghostty` configuration file, usually located at `$HOME/.config/ghostty/config`
22+
23+
background = ${bg}
24+
foreground = ${fg}
25+
cursor-color = ${white0}
26+
selection-background = ${gray1}
27+
selection-foreground = ${white0}
28+
29+
palette = 0=${black0}
30+
palette = 1=${red.base}
31+
palette = 2=${green.base}
32+
palette = 3=${yellow.base}
33+
palette = 4=${blue0}
34+
palette = 5=${blue2}
35+
palette = 6=${magenta.base}
36+
palette = 7=${white0}
37+
38+
palette = 8=${gray2}
39+
palette = 9=${red.bright}
40+
palette = 10=${green.bright}
41+
palette = 11=${yellow.bright}
42+
palette = 12=${blue2}
43+
palette = 13=${magenta.bright}
44+
palette = 14=${cyan.bright}
45+
palette = 15=${white1}
46+
]],
47+
colors
48+
)
49+
end
50+
51+
return M

0 commit comments

Comments
 (0)