Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Software
Mock
Commits
ed0df34c
Commit
ed0df34c
authored
Jun 08, 2019
by
Nicolas Lenz
Browse files
Merge branch 'master' of git.eisfunke.com:software/Mock
parents
eee61c58
8b975f59
Changes
3
Show whitespace changes
Inline
Side-by-side
package.yaml
View file @
ed0df34c
name
:
mock
name
:
mock
version
:
3.
3
.0
version
:
3.
4
.0
license
:
WTFPL
license
:
WTFPL
git
:
"
https://git.eisfunke.com/software/mock"
git
:
"
https://git.eisfunke.com/software/mock"
author
:
"
Nicolas
Lenz"
author
:
"
Nicolas
Lenz"
...
...
src/Mock.hs
View file @
ed0df34c
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE OverloadedStrings
, LambdaCase
#-}
module
Mock
(
styles
,
mockAlternate
,
mockRandom
,
letterspace
,
toDouble
)
where
module
Mock
(
styles
,
mockAlternate
,
mockRandom
,
letterspace
,
toDouble
)
where
...
@@ -24,6 +24,7 @@ styles = [
...
@@ -24,6 +24,7 @@ styles = [
(
"lower"
,
T
.
toLower
),
(
"lower"
,
T
.
toLower
),
(
"double"
,
T
.
map
toDouble
),
(
"double"
,
T
.
map
toDouble
),
(
"dedouble"
,
T
.
map
fromDouble
),
(
"dedouble"
,
T
.
map
fromDouble
),
(
"smallcaps"
,
T
.
map
toSmallCap
),
(
"cc"
,
mockCC
),
(
"cc"
,
mockCC
),
(
"b"
,
mockB
),
(
"b"
,
mockB
),
(
"square"
,
mockSquare
)]
(
"square"
,
mockSquare
)]
...
@@ -78,6 +79,35 @@ fromDouble c = case ord c of
...
@@ -78,6 +79,35 @@ fromDouble c = case ord c of
|
120146
<=
code
&&
code
<=
120171
->
chr
$
code
-
120146
+
97
|
120146
<=
code
&&
code
<=
120171
->
chr
$
code
-
120146
+
97
code
->
chr
code
code
->
chr
code
toSmallCap
::
Char
->
Char
toSmallCap
=
\
case
'a'
->
chr
7424
'b'
->
chr
665
'c'
->
chr
7428
'd'
->
chr
7429
'e'
->
chr
7431
'f'
->
chr
42800
'g'
->
chr
610
'h'
->
chr
668
'i'
->
chr
618
'j'
->
chr
7434
'k'
->
chr
7435
'l'
->
chr
671
'm'
->
chr
7437
'n'
->
chr
628
'o'
->
chr
7439
'p'
->
chr
7448
'q'
->
chr
491
'r'
->
chr
640
's'
->
chr
42801
't'
->
chr
7451
'u'
->
chr
7452
'v'
->
chr
7456
'w'
->
chr
7457
'y'
->
chr
655
'z'
->
chr
7458
c
->
c
-- |Replaces all occurences of lowercase "ck" and "k" in a string with "cc"s.
-- |Replaces all occurences of lowercase "ck" and "k" in a string with "cc"s.
mockCC
::
T
.
Text
->
T
.
Text
mockCC
::
T
.
Text
->
T
.
Text
mockCC
=
T
.
replace
"k"
"cc"
.
T
.
replace
"ck"
"cc"
mockCC
=
T
.
replace
"k"
"cc"
.
T
.
replace
"ck"
"cc"
...
...
src/Mock/Help.hs
View file @
ed0df34c
...
@@ -18,6 +18,7 @@ styleHelp styleName = case styleName of
...
@@ -18,6 +18,7 @@ styleHelp styleName = case styleName of
"lower"
->
"Turns all characters into lowercase ones."
"lower"
->
"Turns all characters into lowercase ones."
"double"
->
"Turns characters (latin letters and numbers) into their double-struck variants (𝕖𝕩𝕒𝕞𝕡𝕝𝕖). Also known as blackboard bold."
"double"
->
"Turns characters (latin letters and numbers) into their double-struck variants (𝕖𝕩𝕒𝕞𝕡𝕝𝕖). Also known as blackboard bold."
"dedouble"
->
"Turns double-struck characters (like from the
\"
double
\"
style) back into normal ones."
"dedouble"
->
"Turns double-struck characters (like from the
\"
double
\"
style) back into normal ones."
"smallcaps"
->
"Turns lowercase letters into small capitals."
"cc"
->
"Replaces all occurences of lowercase
\"
c
\"
,
\"
ck
\"
and
\"
k
\"
with
\"
cc
\"
."
"cc"
->
"Replaces all occurences of lowercase
\"
c
\"
,
\"
ck
\"
and
\"
k
\"
with
\"
cc
\"
."
"b"
->
"Replaces all occurences of Bs (lower- and uppercase) with B-button emojis (🅱)."
"b"
->
"Replaces all occurences of Bs (lower- and uppercase) with B-button emojis (🅱)."
"square"
->
"Shows the input spaced in the first line and the tail of the input lined afterwards."
"square"
->
"Shows the input spaced in the first line and the tail of the input lined afterwards."
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment