RDOCがURLを解析するのを防ぐにはどうすればよいですか?

StackOverflow https://stackoverflow.com/questions/4676167

  •  10-10-2019
  •  | 
  •  

質問

フォロークラスがあると仮定します。

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>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top