Skip to content

Commit

Permalink
fixup! doc(index): add link to homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
litlighilit committed Jan 3, 2025
1 parent eb5b908 commit 619e56c
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/pylib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ when defined(nimdoc):
from pylib/version import Version
import std/macros
import std/strformat
import std/strutils
macro doc(s: static[string]): untyped = newCommentStmtNode s

template hs(s): string = "https://" & s
Expand All @@ -23,10 +24,17 @@ when defined(nimdoc):

const
homepage{.strdefine.} = hs"nimpylib.github.io/pylib"
func stripDoc(s: string): string =
result = s
var proto: string
let ls = s.split(':', 1)
(proto, result) = (ls[0], ls[1])
result.removePrefix"docs."
result = proto & ':' & result

doc "> Welcome to **NimPyLib** :sub:`" & Version & "`" # Nim's Markdown is RST-extended
doc fmt"""- link to {link("repo", ReadmeUrl)}, {link("wiki", WikiUrl)}
""" & link("home", homepage)
doc fmt"""- link to {link("repo", ReadmeUrl)}, {link("wiki", WikiUrl)}, """ &
link("home", stripDoc homepage)
## .. include:: ../doc/pylib.md
doc ".. warning:: " & WarnLeniOps

Expand Down

0 comments on commit 619e56c

Please sign in to comment.