Come faccio a impedire RDoc da parsing di un URL?
Domanda
Si supponga che ho la classe di follow.
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
E poi corro attraverso rdoc.
$ rdoc foo.rb
Si genera in questo modo:
<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>
lo voglio per generare qualcosa di simile a questo, invece:
<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>
Quale sarebbe il modo migliore per ottenere questo risultato?
Soluzione
Passaggio 1
Assicurarsi che si sta utilizzando:
ruby 1.9.2
rdoc 2.5.8
Passaggio 2
fuga di esso e si dovrebbe andare bene.
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
Output:
<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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow