Tags:
archive_me1Add my vote for this tag create new tag
, view all tags
Here's a simple patch to the March beta that enables a simpler syntax for external links: [[http://twiki.org/ TWiki home]]. Having used the standard external links a lot recently, I find this much easier to type than [[http://twiki.org/][TWiki home]] - for some reason typing '][' feels a bit weird, and is certainly slower than hitting the space bar. A similar syntax is also used on the MoinMoin:FrontPage wiki (see MoinMoin:HelpOnLinking).

To avoid breaking forced internal links, e.g. [[web home]], the code matches [a-z]+\: (i.e. something like 'http:') as the first part of the first word, which seems reasonable as that's not a valid WikiWord.

This is a one line addition to the March beta:

*** TWiki.pm.ori        Sun Jul 15 19:11:09 2001
--- TWiki.pm    Sun Jul 15 19:50:18 2001
***************
*** 1183,1188 ****
--- 1183,1191 ----
  # Make internal links
              # '[[Web.odd wiki word#anchor][display text]]' link:
              s/\[\[(.*?)\]\[(.*?)\]\]/&specificLink("",$theWeb,$theTopic,$2,$1)/geo;
+             # Added by Richard Donkin, 15 July 2001 - easier linking
+             # '[[URL#anchor display text]]' link:
+             s/\[\[([a-z]+\:\S+)\s+(.*?)\]\]/&specificLink("",$theWeb,$theTopic,$2,$1)/geo;
              # '[[Web.odd wiki word#anchor]]' link:
              s/\[\[(.*?)\]\]/&specificLink("",$theWeb,$theTopic,$1,$1)/geo;

Any comments? This is much easier to type, and shouldn't conflict with anything else (I've tested internal links and traditional external links, and links with anchors), so it would be great to see it go into TWiki.

-- RichardDonkin - 15 Jul 2001

I'm finding this syntax much nicer to type - if nobody else is interested, is it possible to do this as a plugin? I suspect not, as it needs to be done before a [[link like this]] is processed.

Also, it would be nice to be able to provide a nicer link for some InterWikis links - e.g. this would let me show MoinMoin:FrontPage as a link to 'the MoinMoin wiki', by writing [[MoinMoin:FrontPage the MoinMoin wiki]].

-- RichardDonkin - 17 Jul 2001

I think this is an excellent idea, as it gives something a lot better than <a href .... When I use the existing format, I wonder if I'd be better of just using html. Perhaps it would be worth allowing this for internal links as well, although this does mean a bit more typing if you just want to space a WikiName out e.g. [[Wiki Name]] would need to be [[WikiName Wiki Name]] (this would make renaming easier). The extra brackets would therefore be redundant.

-- JohnTalintyre - 18 Jul 2001

I've started using this on our live TWiki and it is quite convenient.

One way of supporting internal links would be to recognise where the first word within double-parens is a WikiWord, e.g. [[Main.WikiWord link to wiki page]] would come out as link to wiki page, while [[wiki word]] would come out as wiki word. I'm not sure how many people use the word-spaced-out format, i.e. [[easier external linking]] - I find it doesn't cope well with acronyms as part of the Wiki word, so have never really used it, but if we recognise when the first word is a Wiki word, we can still support this.

Interesting point about renaming, but if people like the words-spaced-out style I guess you will still need to support that.

-- RichardDonkin - 18 Jul 2001

I don't like (and would want to disable) the [[easier external linking]] syntax - I'd rather have BumpyWordsForDocumentWriting and SpacedWikiWordPlugin. That's my vote anyhow.

-- MartinCleaver - 18 Jul 2001

See BrokenGeneratedLinks for a bug (and fix) that may affect users of this feature, as well as users of [[internal links with spaced out words]]. Apply this at the same time as the patch above.

-- RichardDonkin - 28 Jul 2001

I think a comma would make a better separator than a space. Comma's are already widely used for seperating items in a list and makes for easier reading as well.

-- MattWilkie - 26 Nov 2001

Are you talking about commas for the word-spaced-out format? If you are talking about the proposed new external link format, commas are already used as valid URL characters, so it would not be easy for the reader (or TWiki) to distinguish the first word of the link description from part of the URL. I find space quite easy for separating the URL from the description, and have been using it like this for some time.

-- RichardDonkin - 26 Nov 2001

I was talking about using a comma instead of ][ to seperate the URL from the displayed words. I didn't know a comma is a valid URL character. Also I've played around a bit with example links and I'm not so confident anymore that a comma is any more readable than a simple space.

-- MattWilkie - 27 Nov 2001

Hey, we have consensus (at least between the two of us smile )

-- RichardDonkin - 12 Jan 2002

This is now implemented in the TWikiAlphaRelease (and now on TWiki.org). Also documented in TextFormattingRules in the beta TWiki.

-- RichardDonkin - 25 Mar 2002

Could this principle also be used for internal links, like: [[WebHome This is my homepage]] ? -- ArthurClemens - 11 Sep 2003

This discussion moved to EasierLinking


Looks like this was in CairoRelease so I'm updating the form data to indicate it was. I've left DocProgress at 0% because I don't know if it has been documented anywhere. It should probably be added to CairoReleaseHistory etc. as well.

-- SamHasler - 07 Sep 2004

Edit | Attach | Watch | Print version | History: r20 < r19 < r18 < r17 < r16 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r20 - 2004-09-07 - SamHasler
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.