docs: update & fix docs

pull/115/head
Amio 2018-08-15 11:27:12 +08:00
rodzic a748ca0969
commit f67013244d
4 zmienionych plików z 11 dodań i 10 usunięć

Wyświetl plik

@ -13,7 +13,7 @@ Home of [badgen.net](https://badgen.net), fast badge generating service.
The [badgen](https://github.com/amio/badgen) library was born as an exploration of "is it possible to generate badge svg markup directly with JavaScript (without using pdfkit/canvas/puppeteer to measure text length)?". Result is better than I expected, Verdana (the de-facto font for badges) text width can be calculated precisely with a prebuilt [char-width-table](https://github.com/amio/badgen/blob/master/lib/widths-verdana-11.json), even no need to worry about kerning 🤯
Then, logically, [Badgen Service](https://badgen.net) was born. I had a good time with [shields.io](https://shields.io) (and earlier [badge.fury.io](https://badge.fury.io)), but as time goes by Shields gets slower, leaves more and more broken badges in READMEs. Badgen is trying to be a fast alternative with simplicity and flexibility. Its codebase is well structured and fun to develop - it is pretty easy to add badge(s) for new service(s).
Then, logically, [Badgen Service](https://badgen.net) was born. I had a good time with [shields.io](https://shields.io), but as time goes by Shields gets slower, leaves more and more broken badges in READMEs. Badgen is trying to be a fast alternative with simplicity and flexibility. Its codebase is well structured and fun to develop - it is pretty easy to add badge(s) for new service(s).
At the beginning I was considering between [Now](https://zeit.co/now) and [Google Cloud Functions](https://cloud.google.com/functions/). Then Zeit announced [Now CDN](https://zeit.co/blog/now-cdn) on the same day as badgen.now.sh (the PoC of Badgen Service)'s reveal, what a fate! Base such service on Zeit's Now CDN is the perfect choice, we can stop thinking about caching and scalability issues. Badgen is the fastest possible badge generating service out there. It's fast, it's reliable, it's globally distributed and cached, because of Now.

Wyświetl plik

@ -1,13 +1,13 @@
# /https
create arbitrary live badge from arbitrary endpoint
Create arbitrary live badge from arbitrary endpoint.
![](/badge/badgen/https)
## Usage
- `/https/:url` _generate badge by data from https://<url>_
- `/https/:url/:args` _generate badge by data from https://<url> with args_
- `/https/:url` _generate badge by data from https://&lt;url>_
- `/https/:url/:args` _generate badge by data from https://&lt;url> with args_
## How to

Wyświetl plik

@ -14,7 +14,7 @@ https://badgen.net/badge/:subject/:status/:color?icon=github
│ │ │ │
│ TEXT TEXT RGB / COLOR_NAME ( optional )
"badge" - default(static) badge generator
"badge" - default (static) badge generator
```
Available color names:
@ -63,11 +63,11 @@ Available icons:
Available query params:
- `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]
- `list` Set `list=1` will replace `,` with ` | ` in status text. [e.g.][list-eg-href]
- `label` Override default subject text ([URL-Encoding][url-enc-href] needed for spaces or special characters).
Advance usage:
Advanced usage (for badge makers):
- [`/runkit`](/docs/runkit) create arbitrary live badge with RunKit's online IDE.
- [`/https`](/docs/https) create arbitrary live badge from arbitrary endpoint.

Wyświetl plik

@ -14,10 +14,11 @@ module.exports = serveMarked('libs/index.md', {
pre, code { background-color: #EEF2F8; font-weight: 400 }
pre > code { padding: 0 }
li { vertical-align: top; font: 14px/26px sans-serif; color: #666 }
li { vertical-align: top; font: 16px/32px sans-serif; color: #777 }
li code { padding: 0.3em 0.5em; display: pre; color: #333 }
a code { color: #06D }
td + td { padding-right: 20rem }
td + td a { font-family: monospace; margin-right: 20rem }
dl { margin-top: 0 }
dt { margin-bottom: 1em; padding-top: 1em; border-bottom: 1px solid #DDD; line-height: 2em }