{"size": 1096, "ext": "scrbl", "max_stars_repo_path": "pangu/scribblings/pangu.scrbl", "max_stars_repo_name": "kisaragi-hiu/pangu.rkt", "max_stars_repo_stars_event_min_datetime": "2020-01-27T07:05:29.000Z", "max_stars_repo_stars_event_max_datetime": "2020-01-27T07:05:29.000Z", "max_issues_repo_path": "pangu/scribblings/pangu.scrbl", "max_issues_repo_name": "kisaragi-hiu/pangu.rkt", "max_issues_repo_issues_event_min_datetime": "2019-12-16T22:23:46.000Z", "max_issues_repo_issues_event_max_datetime": "2019-12-25T18:11:24.000Z", "max_forks_repo_path": "pangu/scribblings/pangu.scrbl", "max_forks_repo_name": "kisaragi-hiu/pangu.rkt", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 1, "max_forks_count": null, "avg_line_length": 28.8421052632, "max_line_length": 236, "alphanum_fraction": 0.7098540146}
#lang scribble/manual
@(require scribble/eval
          (for-label pangu
                     racket/base))
@(define my-eval (make-base-eval))
@(my-eval `(require pangu))

@title{pangu}
@author{@hyperlink["https://kisaragi-hiu.com"]{Kisaragi Hiu}}

@defmodule[pangu]

@section{English}

Paranoid text spacing for Racket.

Add spaces around CJK characters to make them less cramped.

This is a port of the @hyperlink["https://github.com/vinta/pangu.js"]{pangu family of libraries}. Specifically, the regexps and the test suite are all directly ported from @hyperlink["https://github.com/vinta/pangu.py"]{vinta/pangu.py}.

@section{Mandarin}

@hyperlink["https://github.com/vinta/pangu.js"]{@"@"vinta的盤古之白}移植到Racket上。

基本上是Python版的直譯。

@section{Reference}

@defproc[(spacing [text string?]) string?]{
 Returns a new string with pangu spacing applied.
 @examples[#:eval my-eval
           (spacing "為什麼小明有問題都不Google？因為他有Bing")
           (spacing "當你凝視著bug，bug也凝視著你")]
}

@defproc[(spacing-file [path path-string?]) string?]{
 Apply pangu spacing to the file's contents, and return it as a string.
}