Skip to content

Commit aac13f5

Browse files
committed
Updated documentation
This was overwritten in the merge commit.
1 parent 5e24e98 commit aac13f5

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

readme.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,8 @@ You can provide multiple comma-separated values in the bg_color option to render
309309
- `custom_title` - Sets a custom title for the card _(string)_. Default `Most Used Languages`.
310310
- `disable_animations` - Disables all animations in the card _(boolean)_. Default: `false`.
311311
- `hide_progress` - It uses the compact layout option, hides percentages, and removes the bars. Default: `false`.
312+
- `p` - Configures ranking algorithm, defaults to 1, recommended is 0.5 _(number)_
313+
- `q` - Configures ranking algorithm, defaults to 0, recommended is 0.5 _(number)_
312314

313315
> **Warning**
314316
> Language names should be URI-escaped, as specified in [Percent Encoding](https://en.wikipedia.org/wiki/Percent-encoding)
@@ -345,6 +347,26 @@ Endpoint: `api/pin?username=anuraghazra&repo=github-readme-stats`
345347
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)
346348
```
347349

350+
### Ranking configuration
351+
352+
You can use the `&p=` and `&q=` options to change the method used to rank the languages used. The values must be positive real numbers.
353+
354+
The algorithm used is
355+
356+
```javascript
357+
ranking_index = (byte_count ^ p) * (repo_count ^ q)
358+
```
359+
360+
[Details here.](https://github.com/anuraghazra/github-readme-stats/issues/1600#issuecomment-1046056305)
361+
362+
- `&p=1&q=0` - _(default)_ Orders by byte count
363+
- `&p=0.5&q=0.5` - _(recommended)_ Uses both byte and repo count for ranking
364+
- `&p=0&q=1` - Orders by repo count
365+
366+
```md
367+
[![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)
368+
```
369+
348370
### Demo
349371

350372
[![Readme Card](https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats)](https://github.com/anuraghazra/github-readme-stats)

0 commit comments

Comments
 (0)