¿Cómo puedo evitar RDoc de analizar una dirección URL?
Pregunta
Supongamos que tengo la clase de seguimiento.
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
Y entonces corro a través rdoc.
$ rdoc foo.rb
Genera esto:
<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>
Quiero que genere algo como esto en su lugar:
<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>
¿Cuál sería la mejor manera de lograr esto?
Solución
Paso 1
Asegúrese de que está utilizando:
ruby 1.9.2
rdoc 2.5.8
Paso 2
escapar de ella y que debe estar bien.
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
Salida:
<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>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow