From f67013244d2e75ab3d2f86e673c2a81961bafdc6 Mon Sep 17 00:00:00 2001 From: Amio Date: Wed, 15 Aug 2018 11:27:12 +0800 Subject: [PATCH] docs: update & fix docs --- README.md | 2 +- libs/docs/https.md | 6 +++--- libs/index.md | 8 ++++---- libs/serve-index.js | 5 +++-- 4 files changed, 11 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 5e22825..847d380 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/libs/docs/https.md b/libs/docs/https.md index 069fa18..75647c0 100644 --- a/libs/docs/https.md +++ b/libs/docs/https.md @@ -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://_ -- `/https/:url/:args` _generate badge by data from https:// with args_ +- `/https/:url` _generate badge by data from https://<url>_ +- `/https/:url/:args` _generate badge by data from https://<url> with args_ ## How to diff --git a/libs/index.md b/libs/index.md index 4746b05..9f808fb 100644 --- a/libs/index.md +++ b/libs/index.md @@ -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. diff --git a/libs/serve-index.js b/libs/serve-index.js index b9d81e2..9b9a420 100644 --- a/libs/serve-index.js +++ b/libs/serve-index.js @@ -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 }