Question

Supposons que j'ai la classe de suivi.

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

Et puis je le lance à travers rdoc.

$ rdoc foo.rb

Il génère ceci:

<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>

Je veux générer quelque chose comme ceci:

<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>

Quelle serait la meilleure façon d'y parvenir?

Était-ce utile?

La solution

Étape 1

Assurez-vous que vous utilisez:

ruby 1.9.2
rdoc 2.5.8

Étape 2

échapper et vous devriez être 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

Sortie:

<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>
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top