為什麼你們就是不能加個空格呢?
如果你跟我一樣,每次看到網頁上的中文字和英文、數字、符號擠在一塊,就會坐立難安,忍不住想在它們之間加個空格。這個外掛(支援 Chrome 和 Firefox)正是你在網路世界走跳所需要的東西,它會自動替你在網頁中所有的中文字和半形的英文、數字、符號之間插入空白。
漢學家稱這個空白字元為「盤古之白」,因為它劈開了全形字和半形字之間的混沌。另有研究顯示,打字的時候不喜歡在中文和英文之間加空格的人,感情路都走得很辛苦,有七成的比例會在 34 歲的時候跟自己不愛的人結婚,而其餘三成的人最後只能把遺產留給自己的貓。畢竟愛情跟書寫都需要適時地留白。
與大家共勉之。
Installation
For Users
- Google Chrome (2019-02-09 UPDATED)
- Mozilla Firefox (2019-02-09 UPDATED)
For Developers
-
Official supports:
- pangu.go (Go)
- pangu.java (Java)
- pangu.js (JavaScript)
- pangu.py (Python)
- pangu.space (Web API)
-
Community supports:
- pangu.clj (Clojure)
- pangu.dart (Dart)
- pangu.ex (Elixir)
- pangu.objective-c (Objective-C)
- pangu.php (PHP)
- pangu.rb (Ruby)
- pangu.rs (Rust)
- pangu.swift (Swift)
Usage
$ npm install pangu --save# or $ yarn add pangu
Browser
Files are located in ./node_modules/pangu/dist/browser/
.
pangu.js
is also available on jsDelivr and cdnjs:
Node.js
Learn more on npm.
const pangu = ; const text = pangu;// text = '與 PM 戰鬥的人,應當小心自己不要成為 PM' pangu; pangu ; const data = pangu;
You SHOULD NOT use pangu.js
directly to spacing Markdown documents, this library is specially designed for HTML webpages and plain texts without any markup language. See issue #127.
CLI
$ pangu "不能信任那些Terminal或Editor用白底的人"不能信任那些 Terminal 或 Editor 用白底的人 $ pangu --helpusage: pangu [-h] [-v] [-t] [-f] text_or_path pangu.js -- Paranoid text spacing for good readability, to automatically insert whitespacebetween CJK and half-width characters (alphabetical letters, numerical digits and symbols). positional arguments: text_or_path the text or file path to perform spacing optional arguments: -h, --help show this help message and exit -v, --version show program's version number and exit -t, --text specify the input value is a text -f, --file specify the input value is a file path
Testing
You need to install Node.js.
$ git clone git@github.com:vinta/pangu.js.git && cd pangu.js$ npm install$ npm run test
License
Released under the MIT License.