[Prev]

3.11 URLs, email addresses, paths, and function names

Some constructs used by programming and web documentation have distinctive syntactical structure that is fairly easy to recognize and therefore is formatted specially.

Email addresses are recognized by at character (@). For example

  sampo@iki.fi

introduces an email addess which is formatted using teletype font like this: sampo@iki.fi.

URL formatting is recognized by :// somewhere near beginning of a string, e.g:

  http://foo.bar/goo.htm?123
  www.foo.bar/goo.html?123
  foo.com/goo.html?123
  iki.fi/goo.html?123

introduces an URL which is formatted using teletype font like this: http://foo.bar/goo.htm?123 or like this www.foo.bar or like this for com-net-org domains foo.com, bar.net, wee.org, or like this for two letter country domains: iki.fi.

More examples: www.foo.bar/goo.html?123 or like this for com-net-org domains foo.com/goo.html?123, bar.net/goo.html?123, wee.org/goo.html?123, or like this for two letter country domains: iki.fi/goo.html?123.

More examples: www.foo.bar/goo.html or like this for com-net-org domains foo.com/goo.html, bar.net/goo.html, wee.org/goo.html, or like this for two letter country domains: iki.fi/goo.html.

However, some well known file extensions are recognized separately. For example foo.pl is not a URL in Poland, but rather a file with extension .pl (as in perl(1) script). Similar exceptions apply to foo.cc and foo.hh which are common extensions for C++ source code.

Presence of slash anywhere in a string or presence of dot in middle of a string cause the string to be considered a filesystem path and to be formatted using teletype font. Examples:

  foo.ext
  /foo
  foo/bar
  foo/bar.ext
  foo/wee/bar
  foo/wee/bar.ext
  foo/
  .ext

would format as foo.ext or /foo or foo/bar or foo/bar.ext or foo/wee/bar or foo/wee/bar.ext or foo/ or .ext.

Dotted quad format IP addresses are recognized. There are some provisions for wildcarding or indicating the netmask. Following should work

  192.168.1.*
  192.168.1.0/24
  192.168.1.1

and format as 192.168.1.*, 192.168.1.0/24, or 192.168.1.1.

Uniform resource names are recognized, if they start by urn and colon, like urn:liberty:foo

For benefit of documenting XML, structures like <tag> are recognized and rendered as computer output.

Following an old Unix convention of suffixing function names and manual page entries with parentheses, like this

  function()
  fork(2)
  strlen(3)
  proce_dure(a,b,c)

would format as function() or fork(2) or strlen(3) or proce_dure(a,b,c).

The PlainDoc formatter recognizes these structures and formats them using italic font. In this context the undescore character looses its special meaning (i.e. LaTeX math mode subscript command).

You can prevent the automatic formatting from happeing by wrapping the text in e-tag, like:

  <<e: and/or>>

If you do not want automatic formatting to happen under any circumstances, you can specify:

  <<pdflags: autoformat=0>>

[Prev | Next]
.