From: Peter H. <pjr...@gm...> - 2010-01-12 22:13:15
|
Hi all, I've written a patch that changes the Wikilinks extension to accept piped links a la wikipedia, so [[ALink|click here]] will produce a link with the text "click here". I'm a bit of a git newbie, so I have a simple patch, but I can't figure out how to submit a merge request. Anyway, just wondering if there was interest in including something like this. Peter |
From: Waylan L. <wa...@gm...> - 2010-01-12 23:47:55
|
On Tue, Jan 12, 2010 at 5:13 PM, Peter Harley <pjr...@gm...> wrote: > Hi all, > > I've written a patch that changes the Wikilinks extension to accept piped > links a la wikipedia, so [[ALink|click here]] will produce a link with the > text "click here". I'm a bit of a git newbie, so I have a simple patch, but > I can't figure out how to submit a merge request. > > Anyway, just wondering if there was interest in including something like > this. > Seeing that Markdown already has a simple syntax for creating labels for links, I'm not sure this offers any value. And, if something of the sort was added, I would think it should use the already established syntax of markdown. So perhaps: ``[[ALink]](click here)``. But you might as well just do ``[/ALink](click here)`` with the existing non-wikilink syntax. So no, I'm not interested. Of course, anyone can use there own extensions which define their own syntax. Perhaps you could publish it somewhere and add a link on the wiki [1] for others to find and use if they so choose. If it turns out to be popular, we could always add it later. [1]: http://www.freewisdom.org/projects/python-markdown/Available_Extensions -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg |
From: Yuri T. <qar...@gm...> - 2010-01-13 00:57:33
|
> Seeing that Markdown already has a simple syntax for creating labels > for links, I'm not sure this offers any value. And, if something of > the sort was added, I would think it should use the already > established syntax of markdown. So perhaps: ``[[ALink]](click here)``. > But you might as well just do ``[/ALink](click here)`` with the > existing non-wikilink syntax. I disagree. Furthermore, I had to do the exact same change as Peter suggested for the Lua markdown, because I wanted precisely that feature. For better or worse, the WikiLinks extension already breaks with standard Markdown and it makes sense to build on how it already works. The alternatives you suggested don't really work. [[link]](text) is the _opposite_ of standard markdown, which would be [text](link). Same for [/link](text). We could try doing something like [text](\link), but this would also be quite confusing, since the syntax for wikilink with custom title would be totally different form the basic wikilink. I think if one wants to build a wiki using Markdown, [[link|title]] is really the way to go and Peter's patch does add value to Wikilinks. - yuri |
From: Waylan L. <wa...@gm...> - 2010-01-13 04:32:05
|
On Tue, Jan 12, 2010 at 7:57 PM, Yuri Takhteyev <qar...@gm...> wrote: >> Seeing that Markdown already has a simple syntax for creating labels >> for links, I'm not sure this offers any value. And, if something of >> the sort was added, I would think it should use the already >> established syntax of markdown. So perhaps: ``[[ALink]](click here)``. >> But you might as well just do ``[/ALink](click here)`` with the >> existing non-wikilink syntax. > > I disagree. Furthermore, I had to do the exact same change as Peter > suggested for the Lua markdown, because I wanted precisely that > feature. > > For better or worse, the WikiLinks extension already breaks with > standard Markdown and it makes sense to build on how it already works. > > The alternatives you suggested don't really work. [[link]](text) is > the _opposite_ of standard markdown, which would be [text](link). Same > for [/link](text). Whoops, got my () and [] mixed up. Sorry. Guess I responded a little to quickly there. > We could try doing something like [text](\link), but this would also > be quite confusing, since the syntax for wikilink with custom title > would be totally different form the basic wikilink. Ok, let me try this again, with the correct syntax this time. In markdown, the first thing you come to is the label for a link. The actual link comes after. This happens to be easier for reading - which fits into the markdown philosophy IMO. That being the case, [text](/link) seems better to me than [[link|text]]. Interestingly, both use the exact same number of characters - so wikilinks are not even a shortcut here. The one exception would be if you were using the extensions option to automatically append a path to the wikilink. > I think if one wants to build a wiki using Markdown, [[link|title]] is > really the way to go and Peter's patch does add value to Wikilinks. > Maybe the problem is my aversion to wikilinks in general (yes, I know I wrote the original extension - every time we get a feature request for it I wish I hadn't). When we already have an easy way to define links (using Markdown), the only value, IMO, of wikilinks is to eliminate the need to separately define a label when the label is the same as the link text. Isn't that the whole point of wikilinks to begin with? Adding the option to define labels on wikilinks is just a replication of an existing feature we already have. It might be different if we didn't have that other option. Regardless, if you think its a good idea and want to commit Peter's patch, I can live with it. But he asked if we were interested. Personally, I'm not. P.S. Yes that means that any wiki I would develop would not support wikilinks of any kind if it was up to me alone. I originally wrote the extension as an easy proof of concept to learn how the extension API worked. Once I got the basics worker out I moved on to more complex things and didn't come back to the extension until it became part of Markdown and needed to be updated for the API improvements for 2.0. -- ---- \X/ /-\ `/ |_ /-\ |\| Waylan Limberg |
From: Tom I. <to...@je...> - 2010-01-13 11:19:05
|
On Wed, Jan 13, 2010 at 1:57 AM, Yuri Takhteyev <qar...@gm...> wrote: > The alternatives you suggested don't really work. [[link]](text) is > the _opposite_ of standard markdown, which would be [text](link). Same > for [/link](text). Philosophically speaking (uh oh) is the text inside a Wikilink the link, that just happens to be used as the title of the page? Or is it the title of the page that the web server 'coincidentally' uses as part of the link to that page? Because if it's the latter, [[MyPage]] is a page title with a default server-assigned URL, and [[some link here]](MyPage) would be a more markdown-y way of explicitly specifying the link rather than deriving it from the title. Tom Insam to...@je... |
From: Peter H. <pjr...@gm...> - 2010-01-13 22:10:35
|
Sorry, failure to use "reply to all".... ---------- Forwarded message ---------- From: Peter Harley <pjr...@gm...> Date: 2010/1/13 Subject: Re: [Python-markdown-discuss] WikiLinks extension To: Waylan Limberg <wa...@gm...> 2010/1/13 Waylan Limberg <wa...@gm...>: > On Tue, Jan 12, 2010 at 7:57 PM, Yuri Takhteyev <qar...@gm...> wrote: > That being the case, [text](/link) seems better to me than > [[link|text]]. Interestingly, both use the exact same number of > characters - so wikilinks are not even a shortcut here. The one > exception would be if you were using the extensions option to > automatically append a path to the wikilink. > >> I think if one wants to build a wiki using Markdown, [[link|title]] is >> really the way to go and Peter's patch does add value to Wikilinks. >> > > Maybe the problem is my aversion to wikilinks in general (yes, I know > I wrote the original extension - every time we get a feature request > for it I wish I hadn't). When we already have an easy way to define > links (using Markdown), the only value, IMO, of wikilinks is to > eliminate the need to separately define a label when the label is the > same as the link text. Isn't that the whole point of wikilinks to > begin with? Adding the option to define labels on wikilinks is just a > replication of an existing feature we already have. It might be > different if we didn't have that other option. > > Regardless, if you think its a good idea and want to commit Peter's > patch, I can live with it. But he asked if we were interested. > Personally, I'm not. As you say, it was only a suggestion and I'm not really bothered either way. The real reason I was fiddling about in the first place is that I'm using the wikilinks extension with django to get urls for blog posts from their slugs, so I don't have to hard code links into my posts. The piping syntax was just me getting sidetracked! Anyway, its not really hard to do if anyone else wanted it anyway. It's only a few lines. I've stuck it on dpaste if you want to have a look. http://dpaste.com/hold/144513/ Peter |