Giter Site home page Giter Site logo

ptkdev / all-shields-cli Goto Github PK

View Code? Open in Web Editor NEW
36.0 2.0 6.0 2.95 MB

๐ŸฆŒ Tool to help automate your badges from dotfiles for your markdown.

Home Page: https://npmjs.com/package/@ptkdev/all-shields-cli

License: Other

JavaScript 18.48% Shell 0.32% Smarty 7.21% TypeScript 74.00%
shields badge badges shieldsio shieldsio-client shieldsio-endpoint all-contributors-cli all-shields-cli all-shields-generate all-shields

all-shields-cli's Introduction

all-shields-cli

๐ŸฆŒ all-shields-cli - badges generator

v2.0.2 License: MIT Language: TypeScript ECMAScript: 2019 Discord Server

Tool to help automate your badges of shields.io, badgen.net, fury.io, github action and snyk.io from .all-shieldsrc dotfile for your markdown files. You can use Liquid variables like {{name}} or {{version}} which refer to your package.json. Inspired by all-contributors-cli

๐ŸŽ Support: Donate

This project is free, open source and I try to provide excellent free support. Why donate? I work on this project several hours in my spare time and try to keep it up to date and working. THANK YOU!

Donate Paypal Donate Ko-Fi Donate Github Sponsors Donate Patreon Donate Bitcoin Donate Ethereum

๐Ÿ“Ž Menu

๐Ÿ’ก Features

  • [โœ”๏ธ] Easy to use
  • [โœ”๏ธ] MIT License
  • [โœ”๏ธ] Support: shields.io
  • [โœ”๏ธ] Support: fury.io
  • [โœ”๏ธ] Support: snyk.io
  • [โœ”๏ธ] Support: badgen.net
  • [โœ”๏ธ] Support: github action
  • [โœ”๏ธ] Full customizations!
  • [โœ”๏ธ] Liquid Variables
  • [โœ”๏ธ] Tool to help automate your badges on markdown.
  • [โœ”๏ธ] Badges generator from dotfiles for any markdown

๐Ÿ‘” Screenshot

all-shields-cli

๐Ÿš€ How to use

๐Ÿ”ง Installation

  1. In your node project run: npm install @ptkdev/all-shields-cli --save-dev
  2. In your package.json add script:
	...
	"scripts": {
		"all-shields-generate": "all-shields-cli"
	}
	...
  1. Create .all-shieldsrc and paste sample:
{
	"files": ["README.md"],
	"shields": [
		{
			"id": "my-badges",
			"badges": [
				{
					"url": "https://www.npmjs.com/package/@ptkdev/all-shields-cli",
					"color": "#D3D3D3",
					"label": "package name",
					"title": "package name",
					"message": "{{name}}",
					"style": "flat",
					"logo": "",
					"platform": "shields"
				}
			]
		}
	]
}
  1. Add in your README.md the html comment (my-badges is id from the previous step):
<!-- all-shields/my-badges:START -->
<!-- all-shields/my-badges:END -->
  1. Run npm run all-shields-generate

See folder examples, run with npm run example. Below is available a description of options values.

โš™๏ธ CLI
  1. Install cli package globally: npm install @ptkdev/all-shields-cli -g
  2. Run anywhere: all-shields-cli

You can use npx, example: npx @ptkdev/all-shields-cli

๐Ÿ”‘ Liquid variables

In your .all-shieldsrc dotfile you can use liquid variables like {{name}} or {{version}} which refer to your package.json. Key of package.json is name of liquid variable {{key_from_package.json}}

๐Ÿถ Work with Husky

  1. In your node project run: npm install husky --save-dev (docs)
  2. Setup husky with: npx husky install
  3. Add hook: npx husky add .husky/pre-commit "npm run all-shields-generate"

๐Ÿงฐ Options: Badges Array

Parameter Description Values Default value Available on platforms Available since
platform Define platform discord / shields / fury / snyk / badgen / github shields v1.0.0
custom Set custom string of image url (appended after domain url of badge service) string empty discord, shields, fury, snyk, badgen, github v1.1.0
url If you click on badge open this url URI empty discord, shields, fury, snyk, badgen, github v1.0.0
color Badge hexcode color (right side). NOTE: Overwrited if custom is set. string / hexcode lightgray shields, badgen v1.0.0
label Badge text (left side). NOTE: Overwrited if custom is set. string empty shields, badgen v1.0.0
title Mouse hover alt text string empty discord, shields, fury, snyk, badgen, github v1.0.0
message Badge text (right side). NOTE: Overwrited if custom is set. string empty discord, shields, fury, snyk, badgen, github v1.0.0
style Look of badge. NOTE: Overwrited if custom is set. plastic / flat / flat-square / for-the-badge / social flat shields v1.0.0
logo Show logo (left side). NOTE: Overwrited if custom is set. shields: bitcoin , dependabot , discord , gitlab , npm , paypal , serverfault , stackexchange , superuser , telegram , travis and more on docs.

badgen: airbnb, apple, appveyor, atom, awesome, azure, azurepipelines, bitcoin, buymeacoffee, chrome, circleci, cocoapods, codacy, codebeat, codeclimate, codecov, codeship, commonwl, deepscan, dependabot, discord, dockbit, docker, eclipse, firefox, flow, git, github, gitlab, gitter, googleplay, graphql, haskell, jsdelivr and more on docs
empty shields, badgen v1.0.0
server_id if platform is discord, set your discord server_id DISCORD_SERVER_ID empty discord v1.0.0

๐Ÿ”จ Developer Mode

๐Ÿ Run Project

  1. Clone this repository or download nightly, beta or stable.
  2. Run npm run init
  3. Run npm run build && npm run link (unix require sudo)
  4. Run all-shields-cli anywhere for execute command line tool

or run npm run dev for watch mode.

๐Ÿ“š Documentation

Run npm run docs

๐Ÿ‘‘ Backers and Sponsors

Thanks to all our backers! ๐Ÿ™ Donate 3$ or more on paypal, ko-fi, github or patreon and send me email with your avatar and url.

๐Ÿ‘จโ€๐Ÿ’ป Contributing

I โค๏ธ contributions! I will happily accept your pull request! Translations, grammatical corrections (GrammarNazi you are welcome! Yes my English is bad, sorry), etc... Do not be afraid, if the code is not perfect we will work together ๐Ÿ‘ฏ and remember to insert your name in .all-contributorsrc and package.json file.

Thanks goes to these wonderful people (emoji key):


Patryk Rzucidล‚o

๐Ÿ’ป ๐ŸŒ ๐Ÿ“– ๐Ÿ›

di4urp

๐Ÿ’ป ๐Ÿ›

๐Ÿ’ฐ In the future, if the donations allow it, I would like to share some of the success with those who helped me the most. For me open source is share of code, share development knowledges and share donations!

๐Ÿฆ„ Other Projects

๐Ÿ’ซ License

  • Code and Contributions have MIT License
  • Images and logos have CC BY-NC 4.0 License (Freepik Premium License)
  • Documentations and Translations have CC BY 4.0 License

all-shields-cli's People

Contributors

dependabot[bot] avatar di4urp avatar ptkdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

all-shields-cli's Issues

Add support for GitHub Action

Feature description

Add support for GitHub Action so we can manage, for example, build badges like this one

GitHub CI

Feature motivation

GitHub Actions dedicated to CI/CD pipelines are becoming a "standard" for all repositories.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.