On Thu, Jan 9, 2025 at 1:26 PM Lindsay Lawrence <
lawrence.lindsayj...@gmail.com> wrote:

>
> PS: After all of that, I realize another, and perhaps contextually better,
> solution may be to modify the 'wikiLink function, ={ .. } syntax, to handle
> '#' when parsing the document name?
>

With this change to

wiki/gui.l  'wikiLink

(de wikiLink (Lst)
   (let (CurNm (get This 'nm)
         NmParts (split (car Lst) "#")
         Nm (or (pack (car NmParts)) CurNm)
         Loc (pack Nm "#" (cdr NmParts))
         Str (or (glue " " (cdr Lst)) (pack (car Lst))) )
      (cond
         ((fetch '(nm . +Doc) (fold Nm 0))
            (<href> Str  (pack "?" Loc)) )
         (*Login (<this> '*ID Loc Str))


         (T (ht:Prin Str)) ) ) )

I can now write markup like

={DevForum#viprc  My viprc}

to jump to id in a specific wiki doc

and also

={#viprc My viprc}

to jump to id within the current wiki doc

Yay! Very nice way to hyperlink around long wiki pages, have table of
contents on a page, etc,  and not have to scroll too much

/Lindsay

Reply via email to