Changes

Jump to navigation Jump to search
1,433 bytes added ,  15:41, 15 August 2017
Added: Percent and hash sign in hyphentated URLs, restructuring the page
as well, which behaves like \from[#1].
== How to Typeset URLs === E-Mail mailto ===
<context source=yes>
\setupinteraction[state=start]
<context source=yes>
\setupinteraction[state=start]
\starttext
Send your spam to \goto{visible@mailaddress.zzz}[url(mailto:nobody@example.zzz)]
\stoptext
</context>
=== Escaping of Special Characters ===
 
Note that special characters, eg hash sign, percent sign, must be escaped.
Escaping means that the special character will be processed one step later and it prevents
annoying error messages during compilation.
 
The <code>#</code> sign will be replaced by <code>\#</code>,<br/>
the <code>%</code> sign will be replaced by <code>\%</code>, etc.
 
<context source=yes>
\setupinteraction[state=start]
\useurl [myurl] [www.example.zzz/\#999] []
[www.example.zzz/\#999]
</context>
 
Another way of writing special characters is described below, with hyphenated URLs.
 
== Hyphenated URLs ==
== Hyphenation ==
URLs tend to become large monsters under many circumstances but you may have a good reason not to conceal them from the reader.
This is where hyphenation comes in handy.
\hyphenatedurl{http://bits.blogs.nytimes.com/2010/03/05/a-former-book-designer-says-good-riddance-to-print/?hpw}
</context>
 
=== Hyphenation rules ===
 
This has some characters predefined where Hans “likes” URLs to break (see the list at the beginning of [[source:lang-url.lua|lang-url.lua]], cf. [http://www.ntg.nl/pipermail/ntg-context/2008/032959.html a message on ntg-context]).
If you prefer other characters you can add them via:
</texcode>
Note=== Escaping Special Characters === The method for escaping of special characters described above does not work with command<textcode>\hyphenatedurl</textcode>, unfortunately. Escaping backslash will undesirably appear on the output. In this case, all special characters must be rewritten to commands, see the following table: the <table><tr><td><code>#%</code> sign should be escaped, that is, replaced by </td><td><textcode>\letterpercent</textcode></td></tr><tr><td><code>\#</code>.</td><td><textcode>\letterhash</textcode></td></tr></table>
A custom symbol can be inserted as well, eg in case of a linebreak:
<texcode>
\def\hyphenatedurlseparator{↩}
</texcode>
 
These special commands can be used in other cases, like \useURL, too.
== Other ways ==
== Tips and Tricks ==
 
=== Many Different Hyperrefs ===
If you need many hyperrefs in your document these definitions may be handy for you
<context source=yes>
</context>
=== External Links ===
Create a macro for external links in a colour that is distinct from other document links.
58

edits

Navigation menu