1

次のクラスがあるとします。

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>

これを達成するための最良の方法は何ですか?

4

1 に答える 1

3

ステップ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>
于 2011-01-13T03:11:41.007 に答える