Forces babel package descriptions to end with a dot.
This commit is contained in:
parent
be534279da
commit
e21999c2c6
1 changed files with 7 additions and 1 deletions
|
|
@ -28,13 +28,19 @@ proc processContent(content: string) =
|
||||||
officialCount = 0
|
officialCount = 0
|
||||||
unofficialList = ""
|
unofficialList = ""
|
||||||
unofficialCount = 0
|
unofficialCount = 0
|
||||||
|
let
|
||||||
|
endings = {'.', '!'}
|
||||||
|
|
||||||
for pkg in jsonArr:
|
for pkg in jsonArr:
|
||||||
assert pkg.kind == JObject
|
assert pkg.kind == JObject
|
||||||
let pkgWeb =
|
let pkgWeb =
|
||||||
if pkg.hasKey("web"): pkg["web"].str
|
if pkg.hasKey("web"): pkg["web"].str
|
||||||
else: pkg["url"].str
|
else: pkg["url"].str
|
||||||
let listItem = li(a(href=pkgWeb, pkg["name"].str), " ", pkg["description"].str)
|
let
|
||||||
|
desc = pkg["description"].str
|
||||||
|
# Review array index access when #1291 is solved.
|
||||||
|
dot = if desc.high > 0 and desc[<desc.high] in endings: "" else: "."
|
||||||
|
listItem = li(a(href=pkgWeb, pkg["name"].str), " ", desc & dot)
|
||||||
if pkg["url"].str.startsWith("git://github.com/nimrod-code") or
|
if pkg["url"].str.startsWith("git://github.com/nimrod-code") or
|
||||||
"official" in pkg["tags"].elems:
|
"official" in pkg["tags"].elems:
|
||||||
officialCount.inc
|
officialCount.inc
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue