kandi background
Explore Kits

github-readme-stats | Dynamically generated stats for your github | Generator Utils library

 by   anuraghazra JavaScript Version: Current License: MIT

 by   anuraghazra JavaScript Version: Current License: MIT

Download this library from

kandi X-RAY | github-readme-stats Summary

github-readme-stats is a JavaScript library typically used in Generator, Generator Utils applications. github-readme-stats has no bugs, it has a Permissive License and it has medium support. However github-readme-stats has 1 vulnerabilities. You can download it from GitHub.
Get dynamically generated GitHub stats on your readmes!. View Demo · Report Bug · Request Feature. Français · 简体中文 · Español · Deutsch · 日本語 · Português Brasileiro · Italiano · 한국어 . Nederlands . नेपाली . Türkçe.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • github-readme-stats has a medium active ecosystem.
  • It has 38038 star(s) with 8796 fork(s). There are 204 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 89 open issues and 555 have been closed. On average issues are closed in 170 days. There are 163 open pull requests and 0 closed requests.
  • It has a neutral sentiment in the developer community.
  • The latest version of github-readme-stats is current.
github-readme-stats Support
Best in #Generator Utils
Average in #Generator Utils
github-readme-stats Support
Best in #Generator Utils
Average in #Generator Utils

quality kandi Quality

  • github-readme-stats has 0 bugs and 0 code smells.
github-readme-stats Quality
Best in #Generator Utils
Average in #Generator Utils
github-readme-stats Quality
Best in #Generator Utils
Average in #Generator Utils

securitySecurity

  • github-readme-stats has 1 vulnerability issues reported (0 critical, 0 high, 1 medium, 0 low).
  • github-readme-stats code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
github-readme-stats Security
Best in #Generator Utils
Average in #Generator Utils
github-readme-stats Security
Best in #Generator Utils
Average in #Generator Utils

license License

  • github-readme-stats is licensed under the MIT License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
github-readme-stats License
Best in #Generator Utils
Average in #Generator Utils
github-readme-stats License
Best in #Generator Utils
Average in #Generator Utils

buildReuse

  • github-readme-stats releases are not available. You will need to build from source code and install.
  • Installation instructions are not available. Examples and code snippets are available.
github-readme-stats Reuse
Best in #Generator Utils
Average in #Generator Utils
github-readme-stats Reuse
Best in #Generator Utils
Average in #Generator Utils
Top functions reviewed by kandi - BETA

kandi has reviewed github-readme-stats and discovered the below as its top functions. This is intended to give you an instant insight into github-readme-stats implemented functionality, and help decide if they suit your requirements.

  • Run a pull request .
  • Calculate the rank of a score .
  • Helper function to return a stats object .
  • Retrieves the top - level languages for a repository .
  • Fetches a repository from a repository .
  • Returns icon colors for the given card .
  • Measures the given text .
  • Wrap text with multiline characters
  • Find a comment in an octet
  • normal distribution function

github-readme-stats Key Features

GitHub Stats Card

GitHub Extra Pins

Top Languages Card

Wakatime Week Stats

Themes

Customization Common Options Stats Card Exclusive Options Repo Card Exclusive Options Language Card Exclusive Options Wakatime Card Exclusive Option

Deploy Yourself

GitHub Stats Card

copy iconCopydownload iconDownload
[![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)

Hiding individual stats

copy iconCopydownload iconDownload
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&hide=contribs,prs)

Adding private contributions count to total commits count

copy iconCopydownload iconDownload
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&count_private=true)

Showing icons

copy iconCopydownload iconDownload
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true)

Themes

copy iconCopydownload iconDownload
![Anurag's GitHub stats](https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&theme=radical)

Customization

copy iconCopydownload iconDownload
&bg_color=DEG,COLOR1,COLOR2,COLOR3...COLOR10

Usage

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

Usage

copy iconCopydownload iconDownload
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra)](https://github.com/anuraghazra/github-readme-stats)

Exclude individual repositories

copy iconCopydownload iconDownload
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&exclude_repo=github-readme-stats,anuraghazra.github.io)](https://github.com/anuraghazra/github-readme-stats)

Hide individual languages

copy iconCopydownload iconDownload
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&hide=javascript,html)](https://github.com/anuraghazra/github-readme-stats)

Show more languages

copy iconCopydownload iconDownload
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&langs_count=8)](https://github.com/anuraghazra/github-readme-stats)

Compact Language Card Layout

copy iconCopydownload iconDownload
[![Top Langs](https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact)](https://github.com/anuraghazra/github-readme-stats)

Wakatime Week Stats

copy iconCopydownload iconDownload
[![willianrod's wakatime stats](https://github-readme-stats.vercel.app/api/wakatime?username=willianrod)](https://github.com/anuraghazra/github-readme-stats)

Quick Tip (Align The Repo Cards)

copy iconCopydownload iconDownload
<a href="https://github.com/anuraghazra/github-readme-stats">
  <img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=github-readme-stats" />
</a>
<a href="https://github.com/anuraghazra/convoychat">
  <img align="center" src="https://github-readme-stats.vercel.app/api/pin/?username=anuraghazra&repo=convoychat" />
</a>

Create a Github badge

copy iconCopydownload iconDownload
...svg
    <tspan x="162.5" text-anchor="middle" y="45.891675" font-size="40" id="years-number">{years}</tspan>
...svg
// https://stackoverflow.com/questions/69164294/create-a-github-badge
import pupa from 'pupa'
import { readFileSync } from 'fs'
import { join } from 'path'
import { dirname } from 'dirname-filename-esm'

const __dirname = dirname(import.meta)
const template = readFileSync(join(__dirname, '../badge.svg'), 'utf8')

export default (req, res) => {
  let { years } = req.query
  if (typeof years !== 'string') return res.status(400).end()
  res.setHeader('Content-Type', 'text/xml')
  res.end(pupa(template, { years }))
}
-----------------------
...svg
    <tspan x="162.5" text-anchor="middle" y="45.891675" font-size="40" id="years-number">{years}</tspan>
...svg
// https://stackoverflow.com/questions/69164294/create-a-github-badge
import pupa from 'pupa'
import { readFileSync } from 'fs'
import { join } from 'path'
import { dirname } from 'dirname-filename-esm'

const __dirname = dirname(import.meta)
const template = readFileSync(join(__dirname, '../badge.svg'), 'utf8')

export default (req, res) => {
  let { years } = req.query
  if (typeof years !== 'string') return res.status(400).end()
  res.setHeader('Content-Type', 'text/xml')
  res.end(pupa(template, { years }))
}

How to create PNG templates with Python

copy iconCopydownload iconDownload
from PIL import Image, ImageDraw, ImageFont #Import PIL functions
class myTemplate(): #Your template
    def __init__(self, name, description, image):
        self.name=name #Saves Name input as a self object
        self.description=description #Saves Description input as a self object
        self.image=image #Saves Image input as a self object
    def draw(self):
        """
        Draw Function
        ------------------ 
        Draws the template
        """
        img = Image.open(r'C:\foo\...\template.png', 'r').convert('RGB') #Opens Template Image
        if self.image != '':
            pasted = Image.open(self.image).convert("RGBA") #Opens Selected Image
            pasted=pasted.resize((278, int(pasted.size[1]*(278/pasted.size[0])))) #Resize image to width fit black area's width
            pasted=pasted.crop((0, 0, 278, 322)) #Crop height
            img.paste(pasted, (31, 141)) #Pastes image into template
            imgdraw=ImageDraw.Draw(img) #Create a canvas
        font=ImageFont.truetype("C:/Windows/Fonts/Calibril.ttf", 48) #Loads font
        imgdraw.text((515,152), self.name, (0,0,0), font=font) #Draws name
        imgdraw.text((654,231), self.description, (0,0,0), font=font) #Draws description

        img.save(r'C:\foo\...\out.png') #Saves output

amaztemp=myTemplate('Hello, world!', 'Hi there', r'C:\foo\...\images.jfif')
amaztemp.draw()

is there a way to align two HTML elements side by side without CSS? How?

copy iconCopydownload iconDownload
<details>
    <summary>Minhas Estátisticas no Github</summary>
    <p>
        <img align="left" src="https://github-readme-stats.vercel.app/api?locale=pt-br&username=carlos3g&theme=radical&show_icons=true&include_all_commits=true" alt="Estátisticas Gerais" />

        <img align="right" src="https://github-readme-stats.vercel.app/api/top-langs?locale=pt-br&username=carlos3g&theme=radical" alt="Techs utilizadas nos projetos">
    </p>
</details>

api generated svg's not rendering in github markdown files

copy iconCopydownload iconDownload
![Tessa's stackoverflow stats](https://api.squeeble.ink/se/?userId=7185314&seSite=stackoverflow&img=false&nameX=22) 
![Tessa's meta exchange stats](https://api.squeeble.ink/se/?userId=388239&seSite=meta&img=false&nameX=22)
![Tessa's ask ubuntu stats](https://api.squeeble.ink/se/?userId=796646&seSite=AskUbuntu&img=false&nameX=22)

Github readme.md align images

copy iconCopydownload iconDownload
<div align="center">
  <div style="display: flex; align-items: flex-start;">
    <img src="https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/>
    <img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515" />
  </div>
</div>
-----------------------
<table>
  <tr>
    <td valign="top"><img src="https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/></td>
    <td valign="top"><img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/></td>
  </tr>
</table>
<div>
    <img align=top src="https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/>
    <img align=top src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/>
<div>
-----------------------
<table>
  <tr>
    <td valign="top"><img src="https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/></td>
    <td valign="top"><img src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/></td>
  </tr>
</table>
<div>
    <img align=top src="https://github-readme-stats.vercel.app/api/top-langs/?username=anuraghazra&layout=compact&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/>
    <img align=top src="https://github-readme-stats.vercel.app/api?username=anuraghazra&show_icons=true&title_color=ffffff&icon_color=34abeb&text_color=daf7dc&bg_color=151515"/>
<div>

Community Discussions

Trending Discussions on github-readme-stats
  • Create a Github badge
  • How to create PNG templates with Python
  • is there a way to align two HTML elements side by side without CSS? How?
  • api generated svg's not rendering in github markdown files
  • Github readme.md align images
Trending Discussions on github-readme-stats

QUESTION

Create a Github badge

Asked 2021-Sep-14 at 18:21

I want to create a badge for Github README (like this for example). I created a function to get the GET value from URL using JavaScript and put it in the SVG, that works when I tried it in local but if I put it in a Markdown file it doesn't change the number.

![No](http://luigitest.altervista.org/widget/font.svg?years=9)

index.svg:

<svg width="200" height="75" xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
style="-webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none;">
  

<g>  
  <rect x="0" y="0" width="125" height="75" style="fill:#F84949F5"></rect>
  <text x="0" y="37.5" font-family="Segoe UI" font-size="16"  font-weight="bold" fill="white">
    <tspan x="62.5" text-anchor="middle" dy="-3.5%">I started</tspan>
    <tspan x="62.5" text-anchor="middle" dy="25%">programming</tspan>
  </text>
  <rect x="124" y="0" width="75" height="75" style="fill:#F84949"></rect>
  <text x="124" y="75" font-family="Segoe UI" font-size="13" fill="white" font-weight="bold">
    <tspan x="162.5" text-anchor="middle" y="45.891675" font-size="40" id="years-number">5</tspan>
    <tspan x="162.5" text-anchor="middle" y="67.5"  font-weight="bold">years ago</tspan>
  </text>
</g>  
<script xlink:href="script.js" />
</svg>

script.js:

function changeNumber() {
    document.getElementById("years-number").textContent = getValue;
}

let getValue;

window.addEventListener("load", function () {
    let name="years";
    if(name=(new RegExp('[?&]'+encodeURIComponent(name)+'=([^&]*)')).exec(location.search))
      getValue = decodeURIComponent(name[1]);
  
    changeNumber();
});

Output in the browser: correct output

Output in markdown (correct one): wrong output

How can I fix it?

ANSWER

Answered 2021-Sep-14 at 18:21

You can create a serverless function using template svg and pupa.

Svg file:

...svg
    <tspan x="162.5" text-anchor="middle" y="45.891675" font-size="40" id="years-number">{years}</tspan>
...svg

Server side code:

// https://stackoverflow.com/questions/69164294/create-a-github-badge
import pupa from 'pupa'
import { readFileSync } from 'fs'
import { join } from 'path'
import { dirname } from 'dirname-filename-esm'

const __dirname = dirname(import.meta)
const template = readFileSync(join(__dirname, '../badge.svg'), 'utf8')

export default (req, res) => {
  let { years } = req.query
  if (typeof years !== 'string') return res.status(400).end()
  res.setHeader('Content-Type', 'text/xml')
  res.end(pupa(template, { years }))
}

I used Vercel to deploy the serverless function. There are ways other than Vercel too.

Link to repl: https://replit.com/@Programmerraj/serverless-api#api/index.js

Link to live example: https://serverless-api-ebon.vercel.app/api?years=6 (change years to be anything).

Link to GitHub repo: https://github.com/ChocolateLoverRaj/serverless-api.

Preview written in markdown in this answer: preview

Source https://stackoverflow.com/questions/69164294

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install github-readme-stats

You can download it from GitHub.

Support

You can add the count of all your private contributions to the total commits count by using the query parameter ?count_private=true.

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Consider Popular Generator Utils Libraries
Compare Generator Utils Libraries with Highest Security
Compare Generator Utils Libraries with Permissive License
Compare Generator Utils Libraries with Highest Reuse
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.