diff --git a/.github/scripts/build_assets/filehandler.py b/.github/scripts/build_assets/filehandler.py index ee57f3f0..42c8cafa 100644 --- a/.github/scripts/build_assets/filehandler.py +++ b/.github/scripts/build_assets/filehandler.py @@ -9,8 +9,8 @@ import re def find_new_icons(devicon_json_path: str, icomoon_json_path: str) -> List[dict]: """ Find the newly added icons by finding the difference between - the devicon_test.json and the icomoon_test.json. - :param devicon_json_path, the path to the devicon_test.json. + the devicon.json and the icomoon.json. + :param devicon_json_path, the path to the devicon.json. :param icomoon_json_path: a path to the iconmoon.json. :return: a list of the new icons as JSON objects. """ @@ -33,8 +33,8 @@ def is_not_in_icomoon_json(icon, icomoon_json) -> bool: Checks whether the icon's name is not in the icomoon_json. :param icon: the icon object we are searching for. :param icomoon_json: the icomoon json object parsed from - icomoon_test.json. - :return: True if icon's name is not in the icomoon_test.json, else False. + icomoon.json. + :return: True if icon's name is not in the icomoon.json, else False. """ pattern = re.compile(f"^{icon['name']}-") @@ -46,7 +46,7 @@ def is_not_in_icomoon_json(icon, icomoon_json) -> bool: def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]: """ - Get all the suitable svgs file path listed in the devicon_test.json. + Get all the suitable svgs file path listed in the devicon.json. :param new_icons, a list containing the info on the new icons. :param icons_folder_path, the path where the function can find the listed folders. @@ -66,6 +66,7 @@ def get_svgs_paths(new_icons: List[dict], icons_folder_path: str) -> List[str]: aliases = [] # create empty list of aliases if not provided in devicon.json for font_version in icon_info["versions"]["font"]: + # if it's an alias, we don't want to make it into an icon if is_alias(font_version, aliases): continue diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 91a0aad8..99e8a5ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,50 +2,227 @@

First of all, thanks for taking the time to contribute! This project can only grow and live by your countless contributions. To keep this project maintable we developed some guidelines for contributions.

-

Submitting icon

+ +

Table of Content

-

Icon formats and naming conventions

-

Each icon comes in different variations:

+ +
+

Overview on Submitting Icon

+

Here is an overview of what you have to do to submit your icons to the repo.

+
    +
  1. Create the svgs for each logo versions that you have
  2. +
  3. Put the svgs for each logo into its own folders in /fonts
  4. +
  5. Update the devicon.json to include the new icon
  6. +
  7. Create a separated pull request (PR) for each icon (no matter how many versions).
  8. +
  9. Include the name of the icon in the pull request title. Follow this format: new icon: {{logoName}} ({{versions}})
  10. +
  11. Optional: Add images of the new icon(s) to the description of the pull request. This would help speed up the review process
  12. +
  13. Optional: Reference the issues regarding the new icon.
  14. +
  15. Wait for a repo maintainer to review your changes. Once they are satisfied, they will build your repo . This will create a PR into your branch.
  16. +
  17. Review the PR. It should contain the icon versions of your svgs. Accept the changes if you are satisfied
  18. +
  19. Once you accept the changes, a maintainer will accept your PR into the repo.
  20. +
+ +
+

Icon Formats and Naming Conventions

+

Each icon can come in different versions. So far, we have:

-This is not mandatory, an icon can only have one or two variations available. Just keep in mind that the minimum is 1 and the maximum 6 (for now). +It is not mandatory to have 6 versions for each icon. An icon can only have one or two variations available. Just keep in mind that the minimum is 1 and the maximum 6 (for now). You must also have at least one version that can be make into an icon.

-The plain and line variations (with or without wordmark) are designed to be available in the final icon font. So they need to stay as simple as possible (one color and ensure that the paths are united before to export to svg). You can use a service like compressor or SVG Editor in order to optimize the svg file. +The plain and line versions (with or without wordmark) are designed to be available in the final icon font. This means they need to stay as simple as possible (one color and ensure that the paths are united before to export to svg). You can use a service like compressor or SVG Editor in order to optimize the svg file.

-The original versions are only available in svg format, so they do not need to be as simple and they can contain numerous colors. +The original versions are only available in svg format, so they do not need to be as simple and can contain numerous colors.

-Some icons are really simple (like the apple one), so the original version can be used for the icon font. In this case, I'll add an alias so they can be found with the "original" or "plain" naming convention. +Some icons are really simple (like the Apple one), so the original version can be used as the plain version and as the icon font. In this case, you'll only need to make only one of the version (either "original" or "plain"). You can then add an alias in the devicon.json so they can be found with either the "original" or "plain" naming convention.

-

Organizational guidelines

+ +
+

Organizational Guidelines

-

Requesting a icon

+ +
+

Update the devicon.json

+

+ Before you open a PR into Devicon, you'd have to update the devicon.json. This is essential for our build script to work and to document your work. +

+

+ Here is the object that each of your logo must have: +

+ +
+  
+    {
+        "name": string, // the official name of the technology. Must be lower case, no space or use the dash '-' character.
+        "tags": string[], // list of tags relating to the technology for search purpose
+        "versions": {
+            "svg": VersionString[], // list the svgs that you have 
+            "font": VersionString[] // list the fonts acceptable versions that you have
+        },
+        "color": string, // the main color of the logo. Only track 1 color
+        "aliases": AliasObj[] // keeps track of the aliases
+    }
+  
+
+ +

+ Here is the AliasObj interface: +

+
+     
+    {
+        "base": VersionString, // the base version
+        "alias": VersionString // the alias version that's similar to the base version
+    }
+  
+
+ +

+ Here is what VersionString means: +

+
    +
  1. If you have "html5-original", the version string would be "original"
  2. +
  3. If you have "react-line-wordmark", the version string would be "line-wordmark"
  4. +
  5. See Icon Formats and Naming Conventions for more details
  6. +
+ +
+

Example

+

+As an example, let's assume you have created the svgs for Amazon Web Services and Redhat logos. +

+

For the Amazon Web Services svgs, you have the following versions: "original", "original-wordmark", "plain-wordmark". However, the "original" version is simple enough to be a "plain" version as well. Note that we are not using the acronym AWS.

+

For the Redhat svg, you have the "original", "original-wordmark", "plain", "plain-wordmark" versions.

+
    +
  1. + Put the svgs for each logo that you have into its own folders in /fonts + +
  2. +
  3. + Update the devicon.json to include the icon (or variations) + +
  4. +
  5. Create a separated pull request (PR) for each icon (no matter how many variations). + +
  6. +
  7. + Include the name of the icon in the pull request. Follow this format: "new icon: {{logoName}} ({{versions}})" + +
  8. +
  9. For the rest of the steps, you can follow Overview on Submitting Icon
  10. +
+ +
+

Requesting an Icon

When you want to request a new icon please feel free to create a issue following some simple guidelines:

+ +
+

Regarding The Build Script

+

To make adding icons easier for repo maintainers, we rely on GitHub Actions, Python, Selenium, and Gulp to automate our tasks.

+

So far, the tasks that we have automated are:

+ \ No newline at end of file diff --git a/README.md b/README.md index 9e8b2a0a..b3d0f31b 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ Devicon aims to gather all logos representing development languages and tools. Each icon comes in several versions: font/svg, original/plain/line, colored/not colored, wordmark/no wordmark. -Devicon it's 80+ icons and 200+ versions. And it's growing! +Devicon has 80+ icons and 200+ versions. And it's growing! See all available icons on the [new website](https://devicons.github.io/devicon/). @@ -104,10 +104,10 @@ if you like to restore the settings stored in the configuration file. The next step is to click on **Generate font** and download the resulting archive. Extract it contents and you will find a [fonts](./fonts) directory next to a `style.css`. Replace the content of the `fonts` folder, -merge the `style.css` with [devicon.css](./devicon.css) and follow the next step to build the final stylesheet. +rename the `style.css` to [devicon.css](./devicon.css) and follow the next step to build the final stylesheet. ### Build and minify stylesheet Run the following command to build the resulting file `devicon.min.css` ```bash -gulp default +npm run build-css ```