This document will guide you through some of the ways that you can contribute to this project.
This project takes several steps to determine the icon to use for a file.
- Look for a known filename
- Look for a known file extension
- Try to match the filename to a glob
- Detect the coding language via gengo and use that language's icon
You will find the icon mappings for filenames, file extensions, and globs
in src/icons/mod.rs. If you want to update the icon associated
with a coding language, you should instead contribute to gengo. The mappings
in this crate are intended to be more specific than a coding language. For example,
a LICENSE file is usually plain text. But, rather than use the icon for plain text
files, we know that the purpose of a LICENSE file is to provide a license, so we use
a license icon instead.
You can pick a new icon from the Nerd Fonts Cheat Sheet. To help make the code readable to both contributors with Nerd Fonts and contributors without Nerd Fonts, follow this standard:
- The string value should be a unicode escape. This will use the hex code at the bottom-right of the icon list item.
- Add a comment with the actual icon.
When adding an icon for a glob, make sure to use the correct syntax for the glob crate.
Match by literal filenames and extensions if you can. This is much cheaper computationally than adding a new glob pattern.
Updating colors is very similar to updating icons. Mostly, you can follow the steps for
updating icons, ignoring any instructions specific to Nerd Fonts. The mappings can be
found in src/colors/mod.rs.
gengo also provides colors for coding languages. If the color you want to update is related to a coding language, you should consider contributing to gengo instead.