This commit is contained in:
Zed 2022-01-10 00:45:35 +01:00
parent db74fa8893
commit 63b9e8dbc1

View file

@ -4,21 +4,21 @@ import strutils, uri, os, re, algorithm
import jester import jester
import router_utils import router_utils
import ".."/[types] import ../types
import ../views/[general, preferences] import ../views/[general, preferences]
export preferences export preferences
let reTitleize = re"(?<![A-z])[a-z]" let titleizeRegex = re"(?<![A-z])[a-z]"
proc titleize(str: string): string = proc titleize(str: string): string =
result = str result = str
var idx = 0 var idx = 0
while idx != -1: while idx != -1:
idx = str.find(reTitleize, start = idx) idx = str.find(titleizeRegex, start = idx)
if idx != -1: if idx != -1:
result[idx] = str[idx].toUpperAscii result[idx] = str[idx].toUpperAscii
idx.inc inc idx
proc findThemes*(dir: string): seq[string] = proc findThemes*(dir: string): seq[string] =
for kind, path in walkDir(dir / "css" / "themes"): for kind, path in walkDir(dir / "css" / "themes"):