Как предотвратить анализ RDOC в URL?
Вопрос
Предположим, что у меня есть следующий класс.
class Foo
# I want the following to appear as-is in my documentation, not as an anchor tag.
#
# http://www.google.com/
#
def bar
puts "bar"
end
end
А потом я запускаю его через RDOC.
$ rdoc foo.rb
Это генерирует это:
<div class="method-description">
<p>
I want the following to appear as-is in my documentation, not as an anchor tag.
</p>
<p>
<a href="http://www.google.com">www.google.com</a>/
</p>
</div>
Я хочу, чтобы это сгенерировало что -то подобное:
<div class="method-description">
<p>
I want the following to appear as-is in my documentation, not as an anchor tag.
</p>
<p>
http://www.google.com/
</p>
</div>
Как бы это ни был лучший способ сделать это?
Решение
Шаг 1
Убедитесь, что вы используете:
ruby 1.9.2
rdoc 2.5.8
Шаг 2
Убежать из него, и все будет в порядке.
class Foo
# I want the following to appear as-is in my documentation, not as an anchor tag.
#
# \http://www.google.com/
#
def bar
puts "bar"
end
end
Выход:
<div class="method-description">
<p>
I want the following to appear as-is in my documentation, not as an anchor tag.
</p>
<p>
http://www.google.com/
</p>
</div>
Не связан с StackOverflow