[Home]WikiSuggestions/LinkPatterns

UseModWiki | WikiSuggestions | RecentChanges | Preferences

Link Pattern Suggestions and Patches

Half-Wiki Words

Cwick has one feature which seems absolutely must-have to me: Half-Wiki Words. As they put it on CWick:ExtraFeatures?, this allows capitalized words (like, England) be treated as WikiWords iff the page already exists. Thus, you avoid MeatBall:AccidentalLinking words like The, but avoid WikiWords like CountryOfEngland?, nor do you have the ineffiency of needing to add in FreeLinks everywhere.

It's obviously NotForEveryone?, but it has strong utility for me, and maybe others. I'm only sort of a novice at perl, so tackling it myself seems a waste of time, but if anybody thinks they could write a patch for this for 1.0 (assuming this is an easy kind of switch), I'd be willing to pay a small token of gratitude. -- JamesStuart?

This would be useless for German, which capitalizes every noun. Or anywhere where Titles Get Used Often. What might be more useful would be something along the lines of Moin:GaGa?, which autolinks any word that's been manually linked once.

Allow embedded numerals

Patch/fix to link pattern, allowing Imap4VsPop3? to be understood as a link to "Imap4VsPop3?" rather than "VsPop3?". The change is to introduce the variable $LowerOrNum? and change the main link pattern. Note this does not affect non-links such as I18N.
 sub InitLinkPatterns {
  my ($UpperLetter, $LowerLetter, $AnyLetter, $LpA, $LpB,  $QDelim, <b>$LowerOrNum</b>);

  ...

  if ($NonEnglish) {
    $UpperLetter .= "\xc0-\xde";
    $LowerLetter .= "\xdf-\xff";
    $AnyLetter   .= "\xc0-\xff";
  }
  <b>$LowerOrNum = $LowerLetter;</b>
  if (!$SimpleLinks) {
    $AnyLetter .= "_0-9";
    <b>$LowerOrNum .= "_0-9";</b>
  }
  $UpperLetter .= "]"; $LowerLetter .= "]"; $AnyLetter .= "]";
  <b>$LowerOrNum .= "]";</b>

  # Main link pattern: lowercase between uppercase, then anything
  $LpA = $UpperLetter . "+" . $LowerLetter . <b>$LowerOrNum . "*"</b> . $UpperLetter
         . $AnyLetter . "*";

  ...

Note: to use Imap4VsPop3 as a valid link without needing to apply this patch, just sorround it with double-square brackets, ie:[[Imap4VsPop3]] works fine: Imap4VsPop3?

I'll vote for this -- SimonDavis

I like this, and I made it the default on DomesuWiki. Digits are effectively considered lowercase letters on Domesu for the purposes of LinkPattern (this is directly opposite to UseMod 0.92's behavior, but not 1.0 which puts them in the AnyLetter? class)-- ChuckAdams

NoWiki Words

<nowikiwordlinks> tag

I have been playing around with using UseModWiki to host a small site for various work related stuff including discussion of Java-related activities. Since the UseModWiki LinkPattern often matches classes named according to the "standard" Java class naming scheme, we often end up with unintended links when taking about something that involves Java class names.

Sometimes this results in nice MeatBall:AccidentalLinking, but more often than not it just pollutes the page with lots of extra question marks. This makes copying text directly from the HTML view of the page error-prone. I know there are various techniques like <nowiki> and using single quotes to break up would-be Wiki:WikiWords, but using these techniques is tedious when writing using text from a name space that has a high percentage of LinkPattern matches. And while these techniques can fix the "copy-and-paste from the HTML view" problems, they tend to create "copy-and-paste from the edit page view" problems.

It seems like a <nowikiwordlinks> tag of some sort would help us out. Inside a region surrounded by such tags we could still use FreeLinks if we really wanted to make a link. Or maybe some sort of REDIRECT like tag at the top of the page that turns off the WikiLinks option for that page only.

This idea is also listed as <nolink> in MeatBall:MeatballWikiSuggestions.

Suggestion: would it be feasible to use ]]Linkpattern[[ to signify a word that musn't be linked?

Such a syntax not only defies what people normally expect from brackets, it's incompatible with freelinks. ]]ThisIsWhy?[it would]?BeIncompatible?[[. Kwiki has a reasonably elegant solution: simply prefix the WikiWord with a bang, !LikeThis


Numbers & Underscore in Links

  if (!$SimpleLinks) {
    $AnyLetter? .= "_0-9";
    $LowerLetter? .= "_"; ##TAB
    $UpperLetter? .= "0-9"; ##TAB
  }

This allows the following additional LinkPatterns

  1. 123IsThisAWord? -- yes (but here it is not the one you expect)
  2. Is123ThisAWord? -- yes (nor is this)
  3. Is_This_A_Word -- yes (this one most definitely should - requires the LowerLetter? line above)
  4. 123_456 -- yes (actually this one is not a good look)

I like this, and added underscore to the LowerLetter? class in DomesuWiki. Since numbers are also considered lowercase, however, example 1 still links the same way as UseMod does, 2 links the way you want them to, 3 actually ends up as a freelink with underscores converted to spaces (I consider this a bug), and 4 still doesn't link at all (and I don't expect it to) -- ChuckAdams

ISBN links

The ISBN pattern adds links to Barnes & Noble, Amazon, and pricescan.com. It doesn't seem to be possible for users to change this by adding another search site.

I was looking at MeatBall:HowBuildingsLearn and found that the search site does not find the lowest cost place to buy the book.

ISBN 0140139966 (amazon.com, search)

Displays as ISBN 0140139966 (alternate, search)

Try http://www.addall.com/New/BestSeller.cgi?isbn=0140139966&dispCurr=USD

They recommend the above link but put this link in the sample (change=2 must erase a cookie for the shipping destination): http://www.addall.com/New/BestSeller.cgi?isbn=0140139966&dispCurr=USD&change=2

I use a Netscape bookmark of this form so I can select an ISBN on the page and click the bookmark to immediately start the search (modified from http://www.google.com/options/buttons.html Netscape bookmarks):

javascript:q=document.getSelection();if(!q){void(q=prompt('Enter ISBN',''))};q=q.replace(/ */g,"");if(q)location.href='http://www2.addall.com/New/submitNew.cgi?location=10000&state=PA&dispCurr=USD&type=ISBN&query='+escape(q)


Handy InterWiki Links

Here are some suggestions for interwiki links:

Local http://www.usemod.com/cgi-bin/wiki.pl?
make links that are portable - provided you edit the intermap file when you move the wiki. Also useful for Local:action=index (for example).
Search http://www.usemod.com/cgi-bin/wiki.pl?search=
link to searches simply from within the wiki. Equivalent to Local:search=
ShowCategory http://www.usemod.com/cgi-bin/wiki.pl?search=Category
my absolute favourite - you can use this to put in a reference to a category without making the current page part of the category. Compare ShowCategory:Wiki with Search:CategoryWiki or Local:search=CategoryWiki

Enjoy. -- JoeChacko

Note: this was implemented in version 1.0 as mentioned in LocalWiki:UseModWiki/NewFeatures --see also DoLinks.


8-Bit Characters in Links

Currently (0.92) you can switch on/off 8-bit characters in links via the $NonEnglish variable. Switching it on is too much for most languages. I suggest to allow specification of additional upper/lowercase characters, e.g. for the german language (in the config file):

        $NonEnglishUpper = "";
        $NonEnglishLower = "";
--StefanTrcek

Date Links

Apologies if this is in the wrong area... I was thinking about investigating how to create links out of text that matches a set of date regexps. For example, 'January 12, 2003' would be a link to a page for 2003-01-12. Similarly, 1/12/2003 would link to the same page, etc... looking for any comments, suggestions. I'll probably take a hack at it soon (10/23/02). --JasonHaslup


UseModWiki | WikiSuggestions | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited December 1, 2009 12:29 am by JuanmaMP (diff)
Search: