Skip to content

Commit 9f8b27f

Browse files
committed
business card generator wip
1 parent 2968ec0 commit 9f8b27f

File tree

12 files changed

+438
-6
lines changed

12 files changed

+438
-6
lines changed

nix/misc.nix

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,33 @@ in
3333
} --disable-optimization --repl-options=-fobject-code --repl-options=-fno-break-on-exception --repl-options=-fno-break-on-error --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j -fghcid")
3434
'';
3535
};
36+
mkGhcidV2 = {
37+
pkg,
38+
sub ? null,
39+
opt ? null,
40+
}:
41+
pkgs.writeShellApplication {
42+
name = "${pkg}${
43+
if sub == null
44+
then ""
45+
else "-${sub}"
46+
}-ghcid";
47+
text = ''
48+
(cd ${repo}/pub/${pkg} && ghcid --test=":main ${
49+
if sub == "test"
50+
then "--fail-fast --color -f failed-examples"
51+
else ""
52+
} ${
53+
if opt == null
54+
then ""
55+
else opt
56+
}" --command="cabal new-repl ${pkg}${
57+
if sub == "test"
58+
then "-"
59+
else ":"
60+
}${sub} --disable-optimization --repl-options=-fobject-code --repl-options=-fno-break-on-exception --repl-options=-fno-break-on-error --repl-options=-v1 --repl-options=-ferror-spans --repl-options=-j -fghcid")
61+
'';
62+
};
3663
mkService = srv: usr: exe: {
3764
lib,
3865
pkgs,

nix/shell.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ in
77
cabal-install = "latest";
88
hspec-discover = "latest";
99
haskell-language-server = "latest";
10+
implicit-hie = "latest";
1011
cabal-fmt = "latest";
1112
ghcid = "latest";
1213
hpack = "latest";

pub/functora/.ghcid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
--restart=cfg
12
--restart=.ghcid
23
--restart=README.md
34
--restart=functora.cabal

pub/functora/cfg/card.toml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
dpi = 96
2+
width = 2100.0
3+
height = 1200.0
4+
padding = 10.0
5+
headFont = "./fonts/larabiefont.ttf"
6+
iconFont = "./fonts/devicons.ttf"
7+
noteFont = "./fonts/rondo.ttf"
8+
9+
[[group]]
10+
[[group.item]]
11+
kind = "Head"
12+
data = "Functora"
13+
size = 50.0
14+
[[group.item]]
15+
kind = "Note"
16+
data = "Hi-end quality software development."
17+
size = 20.0
18+
[[group.item]]
19+
kind = "Note"
20+
data = "Reliable. Functional. Pure."
21+
size = 20.0
22+
[[group.item]]
23+
data = "0xe677"
24+
kind = "Icon"
25+
size = 300.0
26+
[[group.item]]
27+
data = "https://functora.github.io"
28+
kind = "Qr"
29+
size = 500.0
30+
[[group.item]]
31+
data = "https://functora.github.io"
32+
kind = "Note"
33+
size = 50.0
34+
35+
[[group]]
36+
[[group.item]]
37+
kind = "Head"
38+
data = "Converter Web"
39+
size = 50.0
40+
[[group.item]]
41+
data = "0xe636"
42+
kind = "Icon"
43+
size = 50.0
44+
[[group.item]]
45+
data = "https://functora.github.io/apps/currency-converter"
46+
kind = "Qr"
47+
size = 50.0
48+
[[group.item]]
49+
data = "https://functora.github.io/apps/currency-converter"
50+
kind = "Note"
51+
size = 50.0

pub/functora/fonts/devicons.ttf

123 KB
Binary file not shown.

pub/functora/fonts/larabiefont.ttf

65.1 KB
Binary file not shown.

pub/functora/fonts/rondo.ttf

60.5 KB
Binary file not shown.

pub/functora/functora.cabal

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,14 @@ common pkg
3838
default-extensions: StandaloneKindSignatures
3939

4040
if impl(ghc >=9.2.8)
41-
ghc-options: -Wno-operator-whitespace
41+
ghc-options: -Wno-operator-whitespace
4242

4343
if impl(ghc >=9.8.2)
44-
ghc-options: -Wno-missing-poly-kind-signatures -Wno-missing-role-annotations
44+
ghc-options:
45+
-Wno-missing-poly-kind-signatures -Wno-missing-role-annotations
46+
47+
if flag(ghcid)
48+
ghc-options: -Wno-unused-packages
4549

4650
default-extensions:
4751
AllowAmbiguousTypes
@@ -284,6 +288,20 @@ common pkg-elm2miso
284288
, base
285289
, regex-compat
286290

291+
common pkg-card
292+
import: pkg
293+
hs-source-dirs: src/card
294+
build-depends:
295+
, base
296+
, bytestring
297+
, FontyFruity
298+
, functora
299+
, functora:cfg
300+
, JuicyPixels
301+
, qrcode-core
302+
, qrcode-juicypixels
303+
, Rasterific
304+
287305
common pkg-bolt11
288306
import: pkg
289307
hs-source-dirs: src/bolt11
@@ -398,6 +416,12 @@ library elm2miso-lib
398416
visibility: public
399417
exposed-modules: Functora.Elm2Miso
400418

419+
library card-lib
420+
import: pkg-card
421+
exposed: True
422+
visibility: public
423+
exposed-modules: Functora.Card
424+
401425
library bolt11
402426
import: pkg-bolt11
403427
build-depends: functora
@@ -410,6 +434,11 @@ executable elm2miso
410434
main-is: Main.hs
411435
other-modules: Functora.Elm2Miso
412436

437+
executable card
438+
import: pkg-card, exe
439+
main-is: Main.hs
440+
other-modules: Functora.Card
441+
413442
test-suite functora-test
414443
import: pkg
415444
type: exitcode-stdio-1.0
@@ -452,14 +481,14 @@ test-suite functora-test
452481
pkg-prelude, pkg-qr, pkg-aes,
453482
pkg-cfg, pkg-web, pkg-sql,
454483
pkg-money, pkg-rates, pkg-tags,
455-
pkg-soplate, pkg-elm2miso, pkg-bolt11,
456-
pkg-uri
484+
pkg-soplate, pkg-elm2miso, pkg-card,
485+
pkg-bolt11, pkg-uri
457486

458-
ghc-options: -Wno-unused-packages
459487
other-modules:
460488
Functora.Aes
461489
Functora.AesOrphan
462490
Functora.Bolt11
491+
Functora.Card
463492
Functora.Cfg
464493
Functora.CfgOrphan
465494
Functora.Elm2Miso
@@ -488,6 +517,7 @@ test-suite functora-test
488517
build-depends:
489518
, aes
490519
, bolt11
520+
, card-lib
491521
, cfg
492522
, elm2miso-lib
493523
, functora

pub/functora/hie.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
cradle:
2+
cabal:
3+
- path: "./"
4+
component: "lib:functora"
5+
6+
- path: "./src/qr"
7+
component: "functora:lib:qr"
8+
9+
- path: "./src/aes"
10+
component: "functora:lib:aes"
11+
12+
- path: "./src/uri"
13+
component: "functora:lib:uri"
14+
15+
- path: "./src/cfg"
16+
component: "functora:lib:cfg"
17+
18+
- path: "./src/web"
19+
component: "functora:lib:web"
20+
21+
- path: "./src/sql"
22+
component: "functora:lib:sql"
23+
24+
- path: "./src/money"
25+
component: "functora:lib:money"
26+
27+
- path: "./src/rates"
28+
component: "functora:lib:rates"
29+
30+
- path: "./src/tags"
31+
component: "functora:lib:tags"
32+
33+
- path: "./src/soplate"
34+
component: "functora:lib:soplate"
35+
36+
- path: "./src/bolt11"
37+
component: "functora:lib:bolt11"
38+
39+
- path: "./src/elm2miso"
40+
component: "functora:lib:elm2miso-lib"
41+
42+
- path: "./src/elm2miso/Main.hs"
43+
component: "functora:exe:elm2miso"
44+
45+
- path: "./src/elm2miso/Functora/Elm2Miso.hs"
46+
component: "functora:exe:elm2miso"
47+
48+
- path: "./src/card"
49+
component: "functora:lib:card-lib"
50+
51+
- path: "./src/card/Main.hs"
52+
component: "functora:exe:card"
53+
54+
- path: "./src/card/Functora/Card.hs"
55+
component: "functora:exe:card"
56+
57+
- path: "src/test"
58+
component: "functora:test:functora-test"

pub/functora/nix/tools.nix

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
11
with (import ./../../../nix/misc.nix); [
2-
(mkGhcid "functora" "test" null)
2+
(mkGhcidV2 {
3+
pkg = "functora";
4+
sub = "test";
5+
})
6+
(mkGhcidV2 {
7+
pkg = "functora";
8+
sub = "card-lib";
9+
})
10+
(mkGhcidV2 {
11+
pkg = "functora";
12+
sub = "card";
13+
opt = "-f ${toString ../cfg/card.toml}";
14+
})
315
]

0 commit comments

Comments
 (0)