feat: remove `emoji=1` option, make it default

pull/115/head
Amio 2018-08-14 21:53:45 +08:00
rodzic 4d73bc02cb
commit fce5fbb7d3
5 zmienionych plików z 22 dodań i 25 usunięć

Wyświetl plik

@ -8,10 +8,11 @@ Fast badge generating service.
## Usage
```
https://badgen.net/badge/:subject/:status/:color
──┬── ───┬─── ──┬─── ──┬──
│ │ │ └─ RGB / Color Name
│ TEXT TEXT ( optional )
https://badgen.net/badge/:subject/:status/:color?icon=github
──┬── ───┬─── ──┬─── ──┬── ────┬──────
│ │ │ │ └─ Advance Options (label, list, icon)
│ │ │ │
│ TEXT TEXT RGB / COLOR_NAME ( optional )
"badge" - default(static) badge generator
```
@ -62,12 +63,9 @@ Available icons:
Available query params:
| param | desc |
| ----- | ---- |
|`label`| Override default subject text ([URL-Encoding][url-enc-href] needed for spaces or special characters).
|`emoji`| Set `emoji=1` if subject/status text contains emoji.
| `list`| Set `list=1` will replace `,` with ` \| ` in status text. [e.g.][list-eg-href]
| `icon`| Use builtin icon in front of subject text. [e.g.][icon-eg-href]
- `label` Override default subject text ([URL-Encoding][url-enc-href] needed for spaces or special characters).
- `list` Set `list=1` will replace `,` with ` | ` in status text. [e.g.][list-eg-href]
- `icon` Use builtin icon in front of subject text. [e.g.][icon-eg-href]
## Examples

Wyświetl plik

@ -9,14 +9,14 @@ module.exports = (req, res, options = {}) => {
const hostStyle = req.headers.host === 'flat.badgen.net' ? 'flat' : undefined
const { subject, status, color } = req.params
const { style, label, emoji, list, icon } = req.query
const { style, label, list, icon } = req.query
const badge = badgen({
subject: typeof label !== 'undefined' ? label : subject,
status: String(list ? status.replace(/,/g, ' | ') : status),
color: color,
style: style || hostStyle,
emoji: Boolean(emoji),
emoji: true,
icon: builtin[icon]
})

Wyświetl plik

@ -7,18 +7,17 @@ module.exports = serveMarked('libs/index.md', {
body { max-width: inherit }
body > * { width: 960px; margin-left: auto; margin-right: auto; box-sizing: border-box }
h1 + p { letter-spacing: 0.1px }
h1 + p + p { text-align: center }
h1 + p a { display: inline-block; margin-top: 1em; padding: 4px; height: 20px }
h1 + p + p { justify-content: center; display: flex; flex-direction: row; margin: 0 auto; }
h1 + p + p a { display: block; margin-top: 0em; padding: 5px; height: 20px }
img { height: 20px }
table { border-spacing: 0; vertical-align: top; font-family: Roboto, sans-serif; }
td { padding-right: 0.6em; height: 28px; font-size: 14px; white-space: nowrap }
td + td { padding-right: 20rem }
td img { position: relative; top: 2px }
td a { font: 14px/20px monospace; }
pre, code { background-color: #f2f5f9; font-weight: 400 }
pre, code { background-color: #EEF2F8; font-weight: 400 }
pre > code { padding: 0 }
table code { padding: 0.3em 0.5em; display: pre }
li { vertical-align: top; font: 14px/26px sans-serif; color: #666 }
li code { padding: 0.3em 0.5em; display: pre; color: #333 }
td + td { padding-right: 20rem }
dl { margin-top: 0 }
dt { margin-bottom: 1em; padding-top: 1em; border-bottom: 1px solid #DDD; line-height: 2em }

6
package-lock.json wygenerowano
Wyświetl plik

@ -260,9 +260,9 @@
}
},
"badgen": {
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/badgen/-/badgen-2.2.2.tgz",
"integrity": "sha512-5lJ5D3TDJTyxgv4loTqx8WX5x7Y0ByFbldThuV1aozw8b8xnsFhC0JbfitgKaLk5wUP0rnN/SL3dBHEBzc3R2A==",
"version": "2.2.3",
"resolved": "https://registry.npmjs.org/badgen/-/badgen-2.2.3.tgz",
"integrity": "sha512-NOF1FUcuXuf7D7KNd9s3hpzqIivXVwv6M0ZCBhJKGgowZznjPR+H7RUuHRWxPbePiQ3dKbn8mfjZsS0lOTIyFg==",
"requires": {
"unicode-astral-regex": "^1.0.1"
}

Wyświetl plik

@ -18,7 +18,7 @@
},
"dependencies": {
"axios": "^0.18.0",
"badgen": "^2.2.2",
"badgen": "^2.2.3",
"byte-size": "^4.0.3",
"cheerio": "^1.0.0-rc.2",
"chrome-webstore": "^1.0.0",