UsefulInterMapLinks

<< | Cookbook-V1 | >>

Note: The recipes here are for PmWiki versions 0.6 and 1.0 only. For PmWiki 2.0 recipes, see Cookbook.


PmWiki/PmWiki is distributed with a minimal set of "useful" PmWiki/InterMap links:

    PmWiki    http://www.pmichaud.com/wiki/PmWiki       links to PmWiki pages
    Wiki      http://c2.com/cgi/wiki?                   the original wiki
    Meatball  http://www.usemod.com/cgi-bin/mb.pl?      an excellent wiki 
    UseMod    http://www.usemod.com/cgi-bin/wiki.pl?    another one
    ISBN      http://www.amazon.com/exec/obidos/ASIN/   shortcut for books
    Wikipedia http://www.wikipedia.com/wiki/            an online encyclopedia

Thus, one can write Wikipedia:Harry_S_Truman to quickly get to Wikipedia's entry about the former U.S. president.

You can add your own entries to local/localmap.txt for other common and useful locations. This page contains some useful contributions and suggestions.


Add an entry for Google to your localmap.txt intermap file for a Google search or a site specific Google search with lines like the following.

 Google		http://www.google.com/search?q=
 Artword     	http://www.google.com/search?q=site:www.artlex.com+
 Vocab          [(approve links)
  edit
  diff]

As I am typing, if there is something I think a reader might be confused about I can generate a hyperlink to the correct search, as in "Google:pop+tarts"


Wouldn't it be nice if the word could be inserted into a URL, so that an entry in the InterMap like:

 Jargon         http://catb.org/~esr/jargon/html/{0}.html

and the corresponding text

 Jargon:bit-rot

could render the following link:

 http://catb.org/~esr/jargon/html/B/bit-rot.html

Propose a syntax that's somewhat consistent with the rest of the system and I'll see about implementing it. --<#>?

-- Since you like to use $Blah as a replacement keyword, how about $InterMapKeyword like so:

 Jargon http://catb.org/~esr/jargon/html/$InterMapKeyword.html

So the replacement code inside FmtUrlLink (that's where I tried [unsuccessfully] to put it) looks like

 ...
 # $InterMapUrl is the url specified in intermap.txt
 # $KeywordFromWikiInput is the text after the ':' (Jargon:keyword)
 if( preg_match( "^.*\$.*$", $InterMapUrl))
     {
     str_replace( '$InterMapKeyword', $InterMapUrl, $KeywordFromWikiInput);
     }
 ...

— I remember reading something about InterMap's at other wiki sites, and it's probably a good idea to use the same syntax as they do. Here are some links I found by googling:

  • Meatball:InterMap [www.usemod.com] — more links available from this page.
    Including unobvious suggestions such as Google:search-text and Dictionary:some-word .
Actually... there are enough links and information on that page to keep anyone busy for quite some time... :-) -- Christian

You can find an example of an actual localmap used at the LyX Wiki-Wiki site, see localmap.txt. It is documented here. -- Christian


It would be nice to have a directive/keyword that shows the available InterMap links... the markup could be [[$DocumentInterLinks]] or [[$ShowInterLinks]]. And if all it did was produce a table with:

 ||<intermap> || <url>||

that would be fine IMO. -- Christian

Hmm... it might be better with two keywords instead, e.g.: [[$Show-localmap.txt]] and [[$Show-intermap.txt]] so that you know what is in the respective file. -- Christian

Bug with InterMap and '@'

I think it's a bug that you have to use a space ' ' after an InterMap link in a case like this:

SourceRenders as:
@@Meatball:InterMap@@Meatball:InterMap

Instead, you need to write:

SourceRenders as:
@@Meatball:InterMap @@Meatball:InterMap

For that matter... is it even legal to have '@' in a URI? -- Christian

Sure it is--think of mailto:pmichaud@pobox.com. --Pm pmwiki-2.3.33 -- Last modified by {{}}?

from IP: 85.171.160.186 ip should be disabled by default for security reasons