~jzp/casemate

ref: 8a2a3801300b538f3152cd3829c2a19c996fd57e casemate/casemate.scrbl -rw-r--r-- 2.4 KiB
8a2a3801 — Johan Persson v1.1.0 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#lang scribble/manual
@require[@for-label[casemate]]

@title{Casemate}
@author[(author+email "Johan Persson (jzp)" "johan@2130.se" #:obfuscate? #t)]

@section{Synopsis}

@racketmodname[casemate] is a utility library for converting strings, symbols
and byte-strings to various populat case-styles. It's modeled after the
excellent Clojure library @hyperlink["https://github.com/clj-commons/camel-snake-kebab" "camel-snake-kebab"].

@section{Reference}

@defmodule[casemate]

Each of the following procedures take a string-like piece of data
and converts it to the corresponding style.

@defproc[(->PascalCase [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->Camel_Snake_Case [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->camelCase [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->SCREAMING_SNAKE_CASE [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->snake_case [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->kebab-case [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->SCREAMING-KEBAB-CASE [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

@defproc[(->HTTP-Case [string-like (or/c symbol? string? bytes?)])
         (or/c symbol? string? bytes)]

This is an odd one: it performs a lookup on special words that require a
canonical casing, use them if they match, otherwise will fall back on
@code["string-titlecase"].

@section{Copyright & License}

Copyright © 2019 Johan Persson.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation, either version 3 of the
License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received copies of the GNU General Public License
and the GNU Lesser General Public License along with this program.
If not, see @hyperlink["https://www.gnu.org/licenses/" "https://www.gnu.org/licenses/"].