From: Eric Hodel Date: 2009-05-20T02:57:54+09:00 Subject: Re: SM::ToHtml does not convert urls to hyperlinks On May 18, 2009, at 23:30, Shri Borde wrote: > I am trying to use my own output formatter with SimpleMarkup. Things > seems to work, except for hyperlinks not working as expected. I > tried to use SM::ToHtml to simplify things, and even if does not > deal with hyperlinks. Here is the code snippet I am using. > > [...] You should use RDoc::Markup from RDoc 2. RDoc 1's SM is no longer maintained. As described in ri RDoc (for RDoc 2), valid URL formats are: > * Hyperlinks to the web starting http:, mailto:, ftp:, or www. > are recognized. An HTTP url that references an external image > file is converted into an inline . Hyperlinks starting > 'link:' are assumed to refer to local files whose path is > relative to the --op directory. > > Hyperlinks can also be of the form label[url], in which case the > label is used in the displayed text, and url is used as the > target. If label contains multiple words, put it in braces: > {multi > word label}[url]. > > Example hyperlinks: > > link:RDoc.html > http://rdoc.rubyforge.org > mailto:user@example.com > {RDoc Documentation}[http://rdoc.rubyforge.org] > {RDoc Markup}[link:RDoc/Markup.html] So, adjusting your input to fit: $ echo 'This is *bold*. These are urls - http://www.foo.com, foo[http://www.foo.com ]' | rdoc --pipe

This is bold. These are urls - www.foo.com, foo