Merge branch 'gradha-pr_updates_babel_js' into devel
This commit is contained in:
commit
915d3291ab
2 changed files with 8 additions and 9 deletions
|
|
@ -594,7 +594,8 @@ compiler.
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
<div id="officialPkgList"></div>
|
<div id="officialPkgList"><b>If you are reading this you are missing
|
||||||
|
babelpkglist.js or have javascript disabled in your browser.</b></div>
|
||||||
|
|
||||||
Unofficial packages
|
Unofficial packages
|
||||||
-------------------
|
-------------------
|
||||||
|
|
@ -605,7 +606,8 @@ Nimrod programming language.
|
||||||
|
|
||||||
.. raw:: html
|
.. raw:: html
|
||||||
|
|
||||||
<div id="unofficialPkgList"></div>
|
<div id="unofficialPkgList"><b>If you are reading this you are missing
|
||||||
|
babelpkglist.js or have javascript disabled in your browser.</b></div>
|
||||||
|
|
||||||
<script type="text/javascript" src="babelpkglist.js"></script>
|
<script type="text/javascript" src="babelpkglist.js"></script>
|
||||||
<script type="text/javascript" src="http://build.nimrod-lang.org/packages?callback=gotPackageList"></script>
|
<script type="text/javascript" src="http://build.nimrod-lang.org/packages?callback=gotPackageList"></script>
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ proc processContent(content: string) =
|
||||||
var jsonArr = jsonDoc.elems
|
var jsonArr = jsonDoc.elems
|
||||||
|
|
||||||
jsonArr.sort do (x, y: PJsonNode) -> int:
|
jsonArr.sort do (x, y: PJsonNode) -> int:
|
||||||
system.cmp(x["name"].str, y["name"].str)
|
strutils.cmpIgnoreCase(x["name"].str, y["name"].str)
|
||||||
|
|
||||||
var
|
var
|
||||||
officialList = ""
|
officialList = ""
|
||||||
|
|
@ -38,8 +38,7 @@ proc processContent(content: string) =
|
||||||
else: pkg["url"].str
|
else: pkg["url"].str
|
||||||
let
|
let
|
||||||
desc = pkg["description"].str
|
desc = pkg["description"].str
|
||||||
# Review array index access when #1291 is solved.
|
dot = if desc.high > 0 and desc[desc.high] in endings: "" else: "."
|
||||||
dot = if desc.high > 0 and desc[<desc.high] in endings: "" else: "."
|
|
||||||
listItem = li(a(href=pkgWeb, pkg["name"].str), " ", desc & dot)
|
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:
|
||||||
|
|
@ -51,19 +50,17 @@ proc processContent(content: string) =
|
||||||
|
|
||||||
var officialPkgListDiv = document.getElementById("officialPkgList")
|
var officialPkgListDiv = document.getElementById("officialPkgList")
|
||||||
|
|
||||||
officialPkgListDiv.innerHTML.add(
|
officialPkgListDiv.innerHTML =
|
||||||
p("There are currently " & $officialCount &
|
p("There are currently " & $officialCount &
|
||||||
" official packages in the Babel package repository.") &
|
" official packages in the Babel package repository.") &
|
||||||
ul(officialList)
|
ul(officialList)
|
||||||
)
|
|
||||||
|
|
||||||
var unofficialPkgListDiv = document.getElementById("unofficialPkgList")
|
var unofficialPkgListDiv = document.getElementById("unofficialPkgList")
|
||||||
|
|
||||||
unofficialPkgListDiv.innerHTML.add(
|
unofficialPkgListDiv.innerHTML =
|
||||||
p("There are currently " & $unofficialCount &
|
p("There are currently " & $unofficialCount &
|
||||||
" unofficial packages in the Babel package repository.") &
|
" unofficial packages in the Babel package repository.") &
|
||||||
ul(unofficialList)
|
ul(unofficialList)
|
||||||
)
|
|
||||||
|
|
||||||
proc gotPackageList(apiReply: TData) {.exportc.} =
|
proc gotPackageList(apiReply: TData) {.exportc.} =
|
||||||
let decoded = decodeContent($apiReply.content)
|
let decoded = decodeContent($apiReply.content)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue