Wikipedia style [[links]]

19 views
Skip to first unread message

Michael Clerx

unread,
May 19, 2011, 10:03:14 PM5/19/11
to simplewiki
Hi!

First of all, thanks for creating a great piece of software. It's just
what I need for my simple & easy CMS.

I do have one question: Is it still possible to use traditional wiki
style [[link|Title]] links without using [[Symlink:link|Title]] ?
I've hacked the current emitter a bit to make this possible, but
surely there's a cleaner way?

Thanks again,

Henrik Bechmann

unread,
May 23, 2011, 8:19:59 AM5/23/11
to simpl...@googlegroups.com
Hi Michael,

I'm pondering this. As you know there are currently three link formats that are recognized by SimpleWiki:

- a protocol-based link (http:// etc.)
- an anchor (#...)
- a symlink (Symlink:selector).

What I'll probably do is take anything that doesn't pass those tests and call it a "rawlink", and allow users to register a "rawlinkhandler" to do what they will with it, ie verify that the raw link is valid, and then return some url or relative address based on their own rules.

I can't get to this right away (up to my armpits in creating an admin frontend for mustersoftware.net right now), but I'll get to it as soon as I can.

In the meantime any further thoughts, including a couple of examples (link input, translated output) would be welcome.

Thanks for the comments,

- Henrik


--
You received this message because you are subscribed to the Google Groups "simplewiki" group.
To post to this group, send email to simpl...@googlegroups.com.
To unsubscribe from this group, send email to simplewiki+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simplewiki?hl=en.




--
bechmann.ca

Michael Clerx

unread,
May 27, 2011, 10:55:09 AM5/27/11
to simplewiki
I think your approach sounds great, hope you find some time to
implement it :)

Exmaple:
Source: Not what you were looking for? [[home|Go back to the home
page]]
Output: <p>Not what you were looking for? <a href="http://example.com/
home">Go back to the home page</a></p>

As you rightly say, the creation of "http://example.com/home" should
be entirely up to the given rawlinkhandler

Michael

On May 23, 2:19 pm, Henrik Bechmann <hen...@bechmann.ca> wrote:
> Hi Michael,
>
> I'm pondering this. As you know there are currently three link formats that
> are recognized by SimpleWiki:
>
> - a protocol-based link (http:// etc.)
> - an anchor (#...)
> - a symlink (Symlink:selector).
>
> What I'll probably do is take anything that doesn't pass those tests and
> call it a "rawlink", and allow users to register a "rawlinkhandler" to do
> what they will with it, ie verify that the raw link is valid, and then
> return some url or relative address based on their own rules.
>
> I can't get to this right away (up to my armpits in creating an admin
> frontend for mustersoftware.net right now), but I'll get to it as soon as I
> can.
>
> In the meantime any further thoughts, including a couple of examples (link
> input, translated output) would be welcome.
>
> Thanks for the comments,
>
> - Henrik
>

Henrik Bechmann

unread,
May 27, 2011, 2:02:04 PM5/27/11
to simpl...@googlegroups.com
Thanks Michael. I'll probably get to it in the next week or two.

I'm thinking of calling it a "monolink" though.

- Henrik
Message has been deleted

Michael Clerx

unread,
Oct 7, 2013, 3:56:56 PM10/7/13
to simpl...@googlegroups.com
Just noticed the images don't use the rawlink handler. I've changed it in my local copy:


        # symlink for src
        if (!empty($node->linkparts->symlink)) {
            $node = $this->expand_symlink($node);
            $node->decoration->attributes['src'] =  
                $node->linkparts->symlinkpath . $node->linkparts->internalselector;
            $node->decoration->attributedelimiters['src'] = '"';
        }
        # external address for src
        elseif (!empty($node->linkparts->externaladdress)) {
            $node->decoration->attributes['src'] =  
                !empty($node->linkparts->externaladdress)?$node->linkparts->externaladdress:NULL;
            $node->decoration->attributedelimiters['src'] = '"';
        }
        # raw address
        else {
            $node = $this->expand_rawlink($node);
            $node->decoration->attributes['src'] =  
                !empty($node->linkparts->rawlinkaddress)?$node->linkparts->rawlinkaddress:NULL;
            $node->decoration->attributedelimiters['src'] = '"';
        }


Any chance of getting this into the next release?

Michael Clerx

unread,
Oct 8, 2013, 3:07:33 PM10/8/13
to simpl...@googlegroups.com, hen...@bechmann.ca
That's weird, I posted a message with some code, and now it comes up as "could not load this message". Anyone else getting the same thing?

Henrik Bechmann

unread,
Oct 8, 2013, 4:18:02 PM10/8/13
to simpl...@googlegroups.com
Thanks for this Michael,

I'll definitely look into it. I also want to upgrade the markup language to include html5 items.

- Henrik


--
You received this message because you are subscribed to the Google Groups "simplewiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplewiki+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--

Henrik Bechmann

unread,
Oct 8, 2013, 4:22:09 PM10/8/13
to simpl...@googlegroups.com
I don't see any settings preventing that Michael. Try attaching a .zip file?

- Henrik


On Tue, Oct 8, 2013 at 3:07 PM, Michael Clerx <michae...@gmail.com> wrote:
That's weird, I posted a message with some code, and now it comes up as "could not load this message". Anyone else getting the same thing?

--
You received this message because you are subscribed to the Google Groups "simplewiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to simplewiki+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Reply all
Reply to author
Forward
0 new messages