mirror of
https://github.com/zedeus/nitter
synced 2024-11-22 01:45:22 +01:00
Cleanup
This commit is contained in:
parent
db74fa8893
commit
63b9e8dbc1
@ -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"):
|
||||||
|
Loading…
Reference in New Issue
Block a user