Skip to content

Commit

Permalink
solve some errors on gh-pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethosa committed Sep 12, 2023
1 parent b3f3b60 commit 63e5256
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/happyx/bindings/python.nim
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import
nimja,
# HappyX
../ssr/[server, cors],
../core/[constants, exceptions],
../core/[constants, exceptions, queries],
../routing/[routing],
./python_types

Expand Down
9 changes: 5 additions & 4 deletions src/happyx/core/queries.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ import
strutils


proc parseQuery*(query: string): owned(StringTableRef) =
proc parseQuery*(q: string): owned(StringTableRef) =
## Parses query and retrieves StringTableRef object
runnableExamples:
import strtabs
let
query = "a=1000&b=8000&password=mystrongpass"
parsedQuery = parseQuery(query)
assert parsedQuery["a"] == "1000"
let query =
if query.startsWith("?"):
query[1..^1]
if q.startsWith("?"):
q[1..^1]
else:
query
q
result = newStringTable()
for i in query.split('&'):
let splitted = i.split('=')
Expand Down
3 changes: 2 additions & 1 deletion src/happyx/spa/ui/button.nim
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ import
../renderer,
../state,
../components,
./palette
./palette,
json


type ButtonAction* = proc(): void
Expand Down
3 changes: 2 additions & 1 deletion src/happyx/spa/ui/card.nim
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ import
../state,
../components,
./palette,
./enums
./enums,
json


component Card:
Expand Down
3 changes: 2 additions & 1 deletion src/happyx/spa/ui/input.nim
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ import
../renderer,
../state,
../components,
./palette
./palette,
json


type InputAction* = proc(str: cstring): void
Expand Down
2 changes: 2 additions & 0 deletions src/happyx/spa/ui/palette.nim
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
when not defined(docgen):
import dom

import json


const
BackgroundColor* = "#0e090b"
Expand Down
3 changes: 2 additions & 1 deletion src/happyx/spa/ui/progress.nim
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ import
../state,
../components,
./palette,
./enums
./enums,
json


type ProgressAction* = proc(val: int): void
Expand Down
2 changes: 1 addition & 1 deletion src/happyx/ssr/server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ proc onQuit() {.noconv.} =
discard


when not defined(docgen):
when not defined(docgen) and not nim_2_0_0:
setControlCHook(ctrlCHook)
addExitProc(onQuit)

Expand Down

0 comments on commit 63e5256

Please sign in to comment.