Skip to content

Commit

Permalink
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 1124176 commit eb5b908
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
with:
nim-version: ${{ env.nim-version }}
- name: genDoc
run: nimble testDoc --index:on --project ${{ env.git-url-arg }} --outdir:${{ env.deploy-dir }}
run: nimble testDoc --index:on --project ${{ env.git-url-arg }} --outdir:${{ env.deploy-dir }} -d:homepage="${{ github.event.repository.homepage }}"
- name: genLibDoc
run: nimble testLibDoc ${{ env.git-url-arg }} --outdir:${{ env.lib-deploy-dir }}
- name: "Copy to index.html"
Expand Down
9 changes: 7 additions & 2 deletions src/pylib.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,19 @@ when defined(nimdoc):
import std/strformat
macro doc(s: static[string]): untyped = newCommentStmtNode s

template hs(s): string = "https://" & s
const
RepoUrl = "https://github.com/nimpylib/pylib"
RepoUrl = hs"github.com/nimpylib/pylib"
ReadmeUrl = RepoUrl & "?tab=readme-ov-file#nimpylib"
WikiUrl = RepoUrl & "/wiki"
template link(name, url: string): string = "[" & name & "](" & url & ")"

const
homepage{.strdefine.} = hs"nimpylib.github.io/pylib"

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

Expand Down

0 comments on commit eb5b908

Please sign in to comment.