From 7aa35464b3d9937ce753623dec6a93b2aa275c8c Mon Sep 17 00:00:00 2001 From: kitswas <90329875+kitswas@users.noreply.github.com> Date: Tue, 25 Apr 2023 10:00:06 +0530 Subject: [PATCH] Updated the documentation Changes introduced in f2516d60a442dfdbb9e24ddda8743664bcb8064d --- readme.md | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 2eafdc57fd652..479f34c4243a9 100644 --- a/readme.md +++ b/readme.md @@ -309,8 +309,8 @@ You can provide multiple comma-separated values in the bg_color option to render - `custom_title` - Sets a custom title for the card _(string)_. Default `Most Used Languages`. - `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`. - `hide_progress` - It uses the compact layout option, hides percentages, and removes the bars. Default: `false`. -- `p` - Configures language stats algorithm _(number)_ (see [Language stats algorithm](#Language-stats-algorithm)), defaults to 1. -- `q` - Configures language stats algorithm _(number)_ (see [Language stats algorithm](#Language-stats-algorithm)), defaults to 0. +- `size_weight` - Configures language stats algorithm _(number)_ (see [Language stats algorithm](#Language-stats-algorithm)), defaults to 1. +- `count_weight` - Configures language stats algorithm _(number)_ (see [Language stats algorithm](#Language-stats-algorithm)), defaults to 0. > **Warning** > Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding) @@ -360,23 +360,24 @@ Use [show_owner](#customization) variable to include the repo's owner username The top languages card shows a GitHub user's most frequently used top language. > **Note** -> Top Languages does not indicate my skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats. +> Top Languages does not indicate the user's skill level or anything like that; it's a GitHub metric to determine which languages have the most code on GitHub. It is a new feature of github-readme-stats. ### Language stats algorithm We use the following algorithm to calculate the languages percentages on the language card: ```js -ranking_index = (byte_count ^ p) * (repo_count ^ q) +ranking_index = (byte_count ^ size_weight) * (repo_count ^ count_weight) ``` -By default, only the byte count is used for determining the languages percentages shown on the language card (i.e. `p=1` and `q=0`). You can, however, use the `&p=` and `&q=` options to weight the language usage calculation. The values must be positive real numbers. More details about the algorithm can be found [here](Details here.](https://github.com/anuraghazra/github-readme-stats/issues/1600#issuecomment-1046056305)). -- `&p=1&q=0` - _(default)_ Orders by byte count. -- `&p=0.5&q=0.5` - _(recommended)_ Uses both byte and repo count for ranking -- `&p=0&q=1` - Orders by repo count +By default, only the byte count is used for determining the languages percentages shown on the language card (i.e. `size_weight=1` and `count_weight=0`). You can, however, use the `&size_weight=` and `&count_weight=` options to weight the language usage calculation. The values must be positive real numbers. [More details about the algorithm can be found here](https://github.com/anuraghazra/github-readme-stats/issues/1600#issuecomment-1046056305). + +- `&size_weight=1&count_weight=0` - _(default)_ Orders by byte count. +- `&size_weight=0.5&count_weight=0.5` - _(recommended)_ Uses both byte and repo count for ranking +- `&size_weight=0&count_weight=1` - Orders by repo count ```md -[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&p=0.5&q=0.5)](https://github.com/anuraghazra/github-readme-stats) +[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&size_weight=0.5&count_weight=0.5)](https://github.com/anuraghazra/github-readme-stats) ``` ### Usage