From e3526f395da8f2dea06da6cd84d3a0a347f22d27 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 26 Jan 2025 09:43:32 +1100 Subject: [PATCH 1/7] docs: update contribution / icon adding docs --- CONTRIBUTING.md | 25 ++++++++++++++----------- README.md | 6 ++++++ 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4945ab38..f71d5da3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,17 @@ Thank you for your contribution! -## Order - -Please ensure `icons_by_filename`, `icons_by_file_extension`, `icons_by_operating_system`, `icons_by_desktop_environment`, -`icons_by_window_manager` and `filetypes` are ordered alphabetically, to prevent merge conflicts. +## Quick: Add/Change An Icon + +1. Copy or modify a line in `icons-default.lua` and set: + - `icon` + - `color` (dark) + - `name` +1. Run `make` to: + - generate `cterm_color` + - format/order/normalise `icons-default.lua` + - generate `icons-light.lua` +1. Commit both `icons-default.lua` and `icons-default.lua` ## Prerequisites @@ -66,24 +73,20 @@ Add the icon to table **3.**, **4.**, **5.** if the icon is from an OS, DE or WM Each icon must have the following structure (this is an example): ```lua -[".gitconfig"] = { - icon = "", - color = "#41535b", - cterm_color = "0", - name = "GitConfig", -}, + ["lua"] = { icon = "", color = "#51A0CF", cterm_color = "74", name = "Lua" }, ``` ***Key/value pairs must appear in the same exact order!*** - `color` must contain a color in the html notation -- `cterm_color` must be below `color`, and it must contain a number (any number) +- `cterm_color` must contain a number (any number) - the correct value for `cterm_color` will be generated by the script - `name` must only contain alphanumeric characters (don't use `/`, `-`, `_`) Ensure your current working directory is the repo root. Run `make`. This will: - Update `cterm_color` based on `color` +- Format/order/normalise `lua/nvim-web-devicons/icons-default.lua` - Generate `lua/nvim-web-devicons/icons-light.lua` Please commit both `lua/nvim-web-devicons/icons-default.lua` and `lua/nvim-web-devicons/icons-light.lua` diff --git a/README.md b/README.md index 4719a4e8..6d5d3333 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,12 @@ or with [lazy.nvim](https://github.com/folke/lazy.nvim) [![LuaRocks](https://img.shields.io/luarocks/v/nvim-tree/nvim-web-devicons?logo=lua&color=purple)](https://luarocks.org/modules/nvim-tree/nvim-web-devicons) +## Additional Icons + +Additional icons may be added for icons that are present in Nerd Fonts: use the [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet) search for available icons. + +Please submit a Pull Request to add an icon, see [CONTRIBUTING](CONTRIBUTING.md) + ## Usage ### Viewing From b23fcdb91b68dec8819d226c1ad20e649bb0cd92 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 26 Jan 2025 10:11:15 +1100 Subject: [PATCH 2/7] add issue templates --- .github/ISSUE_TEMPLATE/bug_report.yml | 58 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 22 +++++++++ 2 files changed, 80 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.yml create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml new file mode 100644 index 00000000..04c09ccb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -0,0 +1,58 @@ +name: Bug report +description: Report a problem +labels: [bug] +body: + - type: markdown + attributes: + value: | + Before reporting: + * search [existing issues](https://github.com/nvim-tree/nvim-web-devicons/issues) + * ensure that nvim-web-devicons is updated to the latest version + + Please submit a Pull Request to add an icon, see [CONTRIBUTING.md](https://github.com/nvim-tree/nvim-web-devicons/blob/master/CONTRIBUTING.md) + - type: textarea + attributes: + label: "Description" + description: "A short description of the problem you are reporting." + validations: + required: true + - type: textarea + attributes: + label: "Neovim version" + description: "Output of `nvim --version`" + placeholder: | + NVIM v0.10.3 + Build type: RelWithDebInfo + LuaJIT 2.1.1731601260 + render: text + validations: + required: true + - type: input + attributes: + label: "nvim-web-devicons version" + description: "`cd /nvim-web-devicons.lua ; git log --format='%h' -n 1`" + placeholder: | + commit hash + validations: + required: true + - type: input + attributes: + label: "Operating system and version" + placeholder: "Linux 5.16.11-arch1-1, macOS 11.5, Windows 10" + validations: + required: true + - type: input + attributes: + label: "Windows variant" + placeholder: "WSL, PowerShell, cygwin, msys" + validations: + required: false + - type: textarea + attributes: + label: "Expected behavior" + description: "A description of the behavior you expected:" + - type: textarea + attributes: + label: "Actual behavior" + description: "Observed behavior (may optionally include images, videos or a screencast)." + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..0347bccb --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,22 @@ +--- +name: Feature request +about: Suggest an idea for nvim-web-devicons +title: '' +labels: enhancement +assignees: '' + +--- +**Is this a request for a new icon?** +Please submit a Pull Request to add an icon, see [CONTRIBUTING.md](https://github.com/nvim-tree/nvim-web-devicons/blob/master/CONTRIBUTING.md) + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 205eca1f15b7cb29154b43d1d23d5ca911aed97f Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Sun, 26 Jan 2025 12:34:27 +1100 Subject: [PATCH 3/7] use type instead of label --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 04c09ccb..870539cd 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug report description: Report a problem -labels: [bug] +type: bug body: - type: markdown attributes: diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 0347bccb..64e878e0 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for nvim-web-devicons title: '' -labels: enhancement +type: enhancement assignees: '' --- From 09c95a4195c81b4a80a0b43381b2dda593ab0e76 Mon Sep 17 00:00:00 2001 From: hasecilu Date: Sun, 26 Jan 2025 11:55:08 -0600 Subject: [PATCH 4/7] fixup! docs: update contribution / icon adding docs --- CONTRIBUTING.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f71d5da3..d485692c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,6 +76,13 @@ Each icon must have the following structure (this is an example): ["lua"] = { icon = "", color = "#51A0CF", cterm_color = "74", name = "Lua" }, ``` +> [!IMPORTANT] +> If the icon you need is not available on Nerd Fonts you first need to make a +> PR to a project that feeds glyphs to Nerd Fonts. Probably the most adequate +> project to contribute is . +> Take into account that **months** can pass before the icon is available on the +> Nerd Fonts project, once there feel free to open a PR on this project. + ***Key/value pairs must appear in the same exact order!*** - `color` must contain a color in the html notation @@ -143,9 +150,9 @@ See also [The Conventional Commits ultimate cheatsheet](https://gist.github.com/ ## Browser Font -It is useful to see the actual glyphs in the pull request. That can be done by setting the browser font to your nerd font. +It is useful to see the actual glyphs in the pull request. That can be done by setting the browser font to your Nerd Font. -Using firefox: +Using Firefox: - Settings -> General - Fonts -> Advanced From f55b09b6c9d5304bb28eb001b9bb4936127c67bb Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 27 Jan 2025 09:41:51 +1100 Subject: [PATCH 5/7] revert CONTRIBUTING as changes present in #550 --- CONTRIBUTING.md | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d485692c..4945ab38 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,17 +2,10 @@ Thank you for your contribution! -## Quick: Add/Change An Icon - -1. Copy or modify a line in `icons-default.lua` and set: - - `icon` - - `color` (dark) - - `name` -1. Run `make` to: - - generate `cterm_color` - - format/order/normalise `icons-default.lua` - - generate `icons-light.lua` -1. Commit both `icons-default.lua` and `icons-default.lua` +## Order + +Please ensure `icons_by_filename`, `icons_by_file_extension`, `icons_by_operating_system`, `icons_by_desktop_environment`, +`icons_by_window_manager` and `filetypes` are ordered alphabetically, to prevent merge conflicts. ## Prerequisites @@ -73,27 +66,24 @@ Add the icon to table **3.**, **4.**, **5.** if the icon is from an OS, DE or WM Each icon must have the following structure (this is an example): ```lua - ["lua"] = { icon = "", color = "#51A0CF", cterm_color = "74", name = "Lua" }, +[".gitconfig"] = { + icon = "", + color = "#41535b", + cterm_color = "0", + name = "GitConfig", +}, ``` -> [!IMPORTANT] -> If the icon you need is not available on Nerd Fonts you first need to make a -> PR to a project that feeds glyphs to Nerd Fonts. Probably the most adequate -> project to contribute is . -> Take into account that **months** can pass before the icon is available on the -> Nerd Fonts project, once there feel free to open a PR on this project. - ***Key/value pairs must appear in the same exact order!*** - `color` must contain a color in the html notation -- `cterm_color` must contain a number (any number) +- `cterm_color` must be below `color`, and it must contain a number (any number) - the correct value for `cterm_color` will be generated by the script - `name` must only contain alphanumeric characters (don't use `/`, `-`, `_`) Ensure your current working directory is the repo root. Run `make`. This will: - Update `cterm_color` based on `color` -- Format/order/normalise `lua/nvim-web-devicons/icons-default.lua` - Generate `lua/nvim-web-devicons/icons-light.lua` Please commit both `lua/nvim-web-devicons/icons-default.lua` and `lua/nvim-web-devicons/icons-light.lua` @@ -150,9 +140,9 @@ See also [The Conventional Commits ultimate cheatsheet](https://gist.github.com/ ## Browser Font -It is useful to see the actual glyphs in the pull request. That can be done by setting the browser font to your Nerd Font. +It is useful to see the actual glyphs in the pull request. That can be done by setting the browser font to your nerd font. -Using Firefox: +Using firefox: - Settings -> General - Fonts -> Advanced From caae2c6fa66f4c7843ed13476eb7b9e426e3fbcd Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 27 Jan 2025 09:42:52 +1100 Subject: [PATCH 6/7] add missing icon notice --- README.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 6d5d3333..5bce524e 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,13 @@ or with [lazy.nvim](https://github.com/folke/lazy.nvim) Additional icons may be added for icons that are present in Nerd Fonts: use the [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet) search for available icons. -Please submit a Pull Request to add an icon, see [CONTRIBUTING](CONTRIBUTING.md) +> [!IMPORTANT] +> If the icon you need is not available on Nerd Fonts you first need to make a +> PR to a project that feeds glyphs to Nerd Fonts. Probably the most adequate +> project to contribute is . +> Take into account that **months** can pass before the icon is available on the +> Nerd Fonts project, once there feel free to open a PR on this project, see +> [CONTRIBUTING](CONTRIBUTING.md) ## Usage From 755d2f324112ee7ad80ef62375e828b7578ad810 Mon Sep 17 00:00:00 2001 From: Alexander Courtis Date: Mon, 27 Jan 2025 09:44:58 +1100 Subject: [PATCH 7/7] add contributing reference --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5bce524e..3dd73ae2 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ or with [lazy.nvim](https://github.com/folke/lazy.nvim) Additional icons may be added for icons that are present in Nerd Fonts: use the [Cheat Sheet](https://www.nerdfonts.com/cheat-sheet) search for available icons. +PRs are always welcome! Please see [CONTRIBUTING](CONTRIBUTING.md) + > [!IMPORTANT] > If the icon you need is not available on Nerd Fonts you first need to make a > PR to a project that feeds glyphs to Nerd Fonts. Probably the most adequate