How to set internal page links in a PicoLisp Wiki?

2025-01-07 Thread Lindsay Lawrence
Hello,

I have been setting up a (for now) internal wiki using the PicoLisp Wiki.

Is there a straightforward way with the wiki markup syntax to add an id to
a page element, or insert some other kind of id element  so I can link into
a page. This would be particularly useful for longer pages. For example, to
have a content index at the top of a page, or to reference from another
page, jumping straight to the particular point.

I've spent some time looking at the code that processes markup. I may try
and extend that, but was wondering if there is already support there and I
have just missed it.

Regards
/Lindsay


Re: How to set internal page links in a PicoLisp Wiki?

2025-01-07 Thread Lindsay Lawrence
To answer my own question after a bit of investigation:
I added a new markup tag  ;{  } to allow writing snippets of raw html. I
also had to modify the external web link tag to allow urls starting with
"/".  (see code at end).

Now, for example on the DevForum wiki page I can write something like

;{My viprc}

and on another wiki page I can reference it with

;{My viprc}

It works! Yay!

Although, the jump doesn't work when logged into the wiki (i.e. on a
session port different than the default port that the server is listening
on). I'm not sure why.

/Lindsay


In wiki/lib.l:

(de render (Bin)
..
 ("\^"  # External web link
(let S (split (till "}") " " "^I" "^J" "^M")
   (char)
   (if
  (or (member
(car (split (car S) ":"))
(quote
   `(chop "http")
   `(chop "https")
   `(chop "irc")
   `(chop "mailto") ) )
  (= "/" (car S) ) )   # lindsay allow '/?wikipage#part'
links
  (
 (or (glue " " (cdr S)) (pack (car S)))
 (pack (car S)) )
  (prin "???")
  (msg '> "render href? :" S) ) ) )
 (";" (renderBlock prin))  # lindsay allow raw html
..



On Tue, Jan 7, 2025 at 7:43 PM Lindsay Lawrence <
lawrence.lindsayj...@gmail.com> wrote:

> Hello,
>
> I have been setting up a (for now) internal wiki using the PicoLisp Wiki.
>
> Is there a straightforward way with the wiki markup syntax to add an id to
> a page element, or insert some other kind of id element  so I can link into
> a page. This would be particularly useful for longer pages. For example, to
> have a content index at the top of a page, or to reference from another
> page, jumping straight to the particular point.
>
> I've spent some time looking at the code that processes markup. I may try
> and extend that, but was wondering if there is already support there and I
> have just missed it.
>
> Regards
> /Lindsay
>