http://www.perlmonks.org?node_id=142755
tye 's user image
User since: Feb 01, 2002 at 20:03 UTC (22 years ago)
Last here: Jan 01, 2018 at 01:00 UTC (6 years ago)
Experience: 413
Level:Monk (7)
Writeups: none
Location:n/a
User's localtime: Apr 15, 2024 at 21:26 PDT
Scratchpad: View
Member of: gods
For this user:Search nodes

Only used for testing. See tye.


The following is not implemented.

[ This is where I've been testing things. I haven't had a chance to work on it in a while and ar0n's disappeared again. ]

Several shortcuts are available for linking to other documents. To link to:

For best results, be sure to test your links before posting them. Use Preview for links in nodes or /msg yourself for links to be posted in the Chatterbox.


Specifying Link Des‎crip‎tion

To specify the text shown for your link, enter the text (actually HTML) after a | (pipe) character in your []'s. For example, [http://perlmonks.org/|The <em>Perl</em> Monastery] is displayed as The Perl Monastery.

If you do not specify a des‎crip‎tion, your link's criteria is used. For example, [perldoc://perlfaq] is rendered as perlfaq and [http://www.perl.com/] as www.perl.com. Some link types (http://, https://, ftp://, and isbn://) include the link type in the default des‎crip‎tion. Exceptions include:

Footnotes:

1 - While you can use <a href=...> tags to link to pages within the Monastery, it's best to use different approaches for internal links. If you must use an <a href=...> tag, then be sure to use relative URL's (e.g. do not include the "http://www.permonks.(org|com)/index.pl". Otherwise, your link may appear to log people out. Instead start the URL simply with a question mark: <a href="?node_id=...">.

2 - You can locate the ID of many nodes by opening them from Search results, Super Search results, Newest Nodes, or even the author's User Search results. Check the node's URL. If you see a node_id parameter, that's the value you need. If you don't see that parameter, search for the node and then open it. (It may help to include a nonsense word in your search, e.g. "plugh")

3 - This is the same as entering your search terms into the Search box at the top of most nodes.

4 - You can also use [kobe://XML::Parser] (no "s"). This was the original method and there are no plans to stop supporting it.

5 - For best results, verify the ISBN number using FatBrain's search facility, as ISBN number change in new editions. And, yes, the Monastery receives a small kickback if the book is purchased from the link. (If you like, you can provide kickbacks to the Monastery for books ordered from your own web pages).


Advanced options

These link shortcuts come in two forms: [TITLE|DESC] and [WORD://DATA;PARAMS|DESC]. Some special rules and processing apply to each part of a shortcut.

In DATA;PARAMS, the following special sequences are processed:

StringResult
; In DATA, it ends DATA and starts PARAMS. In PARAMS, separates parameters.
&amp;
m[&amp\b;?]i
In DATA, it ends DATA and starts PARAMS. In PARAMS, separates parameters.
? In DATA, it ends DATA and starts PARAMS (and is changed to ; if needed). In PARAMS, adds "?" to the string.
/ In DATA, it ends DATA and starts PARAMS. In PARAMS, adds "/" to the string.
# Indicates that an anchor name is next which tells where in the linked-to page to jump to.
| Ends DATA and PARAMS, starts DESC.
= In DATA, adds "=" to DATA (same as \= would). In PARAM, separates param name from value.
%XX
m[%([\da-f]{2})]i
Adds pack("C",hex($1)) to the string.
\\ \; \& \? \/ \# \| \= \% Adds the second (escaped) character to the string.
\*
m[\\(\W)]
Adds "\\$1" to the string.
\A
m[\\(\w)]
Adds $1 to the string.
% Is treated like \% if it isn't follow by two valid hex characters (it adds a "%" to the string).
&lt;
m[&lt\b;?]i
Adds '<' to the string.
&gt;
m[&gt\b;?]i
Adds '>' to the string.
&quot;
m[&quot\b;?]i
Adds '"' to the string.
&lsb;
m[&lsb\b;?]i
Adds '[' to the string.
&rsb;
m[&rsb\b;?]i
Adds ']' to the string.
&#91;
m[&#(\d+);?]
Adds pack("C",$1) to the string.
& Is treated like &amp; if it doesn't start one of the above HTML escapes (ends DATA or separates parameters).

Examples

Here are some examples showing how the above (rather complex) rules are designed to be do-what-I-mean when constructing links:

last major update by tye - 2003-01-08