mirror of
https://github.com/zedeus/nitter
synced 2026-09-06 07:09:31 +00:00
Render markdown files with a tool
This commit is contained in:
parent
1fc6a4092e
commit
8c2e0c66e2
9 changed files with 45 additions and 21 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import strformat
|
||||
import karax/[karaxdsl, vdom], markdown
|
||||
import karax/[karaxdsl, vdom]
|
||||
|
||||
const
|
||||
date = staticExec("git show -s --format=\"%cd\" --date=format:\"%Y.%m.%d\"")
|
||||
|
|
@ -8,9 +8,12 @@ const
|
|||
link = "https://github.com/zedeus/nitter/commit/" & hash
|
||||
version = &"{date}-{hash}"
|
||||
|
||||
let
|
||||
about = markdown(readFile("public/md/about.md"))
|
||||
feature = markdown(readFile("public/md/feature.md"))
|
||||
let about =
|
||||
try:
|
||||
readFile("public/md/about.html")
|
||||
except IOError:
|
||||
stderr.write "public/md/about.html not found, please run `nimble md`\n"
|
||||
"<h1>About page is missing</h1><br><br>"
|
||||
|
||||
proc renderAbout*(): VNode =
|
||||
buildHtml(tdiv(class="overlay-panel")):
|
||||
|
|
@ -19,7 +22,3 @@ proc renderAbout*(): VNode =
|
|||
p:
|
||||
text "Version "
|
||||
a(href=link): text version
|
||||
|
||||
proc renderFeature*(): VNode =
|
||||
buildHtml(tdiv(class="overlay-panel")):
|
||||
verbatim feature
|
||||
|
|
|
|||
14
src/views/feature.nim
Normal file
14
src/views/feature.nim
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
import karax/[karaxdsl, vdom]
|
||||
|
||||
proc renderFeature*(): VNode =
|
||||
buildHtml(tdiv(class="overlay-panel")):
|
||||
h1: text "Unsupported feature"
|
||||
p:
|
||||
text "Nitter doesn't support this feature yet, but it might in the future. "
|
||||
text "You can check for an issue and open one if needed here: "
|
||||
a(href="https://github.com/zedeus/nitter/issues"):
|
||||
text "https://github.com/zedeus/nitter/issues"
|
||||
p:
|
||||
text "To find out more about the Nitter project, see the "
|
||||
a(href="/about"): text "About page"
|
||||
Loading…
Reference in a new issue