👨💻 about me home CV/Resume News 🖊️ Contact Codeberg Github LinkedIn 🏆 Best of LuaX (tools) pub bang ypp panda lsvg ldc req yreq Fizzbuzz Calculadoira TPG picfg Belenos (intro) dnsfilter badges 🔀 Git Repos
Made in Europe
Lots of GitHub repositories use badges. They are visually nice, but they are also images dynamically built and loaded from third-party servers.
badges generates actually static badges as SVG images
hosted on the same server.
It simply scans files, searches for things that look like a badge filename and generates badges as SVG images.
A badge file is a file in a directory named badges (or a
subdirectory). The filename describes the badge content, color and
size.
text-width-color.svg
text: text displayed in the badgewidth: width in pixels of the badgecolor: background color of the badge (e.g.:
green, 123, 123456)text1-text2-width1-width2-color.svg
text1: first text displayed in the badgetext2: second text displayed in the badgewidth1: width in pixels of the first textwidth2: width in pixels of the second textcolor: background color of the second text (e.g.:
green, 123, 123456)badges makes some substitutions in the text fields:
_ is replaced width (space)@xyz is replaced with the value of the xyz
variable (variables table in the configuration file or
-D CLI option)Special characters in text fields can be escaped:
@@ becomes @__ becomes _ (underscore)-- becomes - (dash)To insert characters that are invalid in a filename, you must use variables.
badges requires LuaX.
# install badges in ~/.local/bin and ~/.local/lib
$ git clone https://codeberg.org/cdsoft/badges
$ cd badges
$ bang && ninja installor set $PREFIX to install badges to a
custom directory ($PREFIX/bin and
$PREFIX/lib):
$ export PREFIX=/path # install badges to /path/bin and /path/lib
$ git clone https://codeberg.org/cdsoft/badges
$ cd badges
$ bang && ninja installThis will install 2 files in $PREFIX/bin:
$PREFIX/bin/badges: badges command line
utility compiled with LuaX. It can be run without any dependency.$PREFIX/bin/badges.lua: badges.lua command
line utility bundled with LuaX as a standalone Lua script. It requires a
Lua 5.4 or 5.5 interpreter (e.g.: lua).In case precompiled binaries are needed (GNU/Linux, MacOS, Windows),
some can be found at cdelord.fr/pub. These archives contain
badges as well as some other softwares more or less related
to LuaX.
Usage: .build/badges [-h] [-v] [-c file.toml] [--init] [-D NAME=VALUE]
[<input>] ...
Arguments:
input files or directories to scan
Options:
-h, --help Show this help message and exit.
-v, --version Show badges version
-c file.toml Configuration file (default: badges.toml)
--init Print the default configuration
-D NAME=VALUE Define a variable
badgesbadges file.md dir1 dir2file1.md and in all files in
dir1 and dir2.
badges -c file.toml ...badges -D V=42 ...@V is replaced with 42).
badges --initThe default configuration is badges.toml.
| Filename | Badge |
|---|---|
badges/License-GPL3-75-45-blue.svg |
|
badges/License-GPL3-75-45-057.svg |
|
badges/Linux-🐧-75-45-771077.svg |
|
badges/3_..._2_..._1-GO-75-45-003500.svg |
|
badges/Badges-75-blue.svg |
|
badges/✅-45-grey.svg |
|
badges/Version-@VERSION-75-45-green.svg |
|
badges/text--with--dashes-and_@@arobases-150-120-28c.svg |
|
badges/__and__underscores__-150-gold.svg |
badges is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
badges is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with badges. If not, see <https://www.gnu.org/licenses/>.
For further information about badges you can visit
https://codeberg.org/cdsoft/badges
This site is powered by LuaX, bang, ypp, cdsoft.css and Pandoc.
Mirrors: cdelord.fr – christophe.delord.free.fr – cdsoft.codeberg.page