简体   繁体   English

有没有办法强制 RDoc 不设置与类或模块相对应的单词样式?

[英]Is there a way to force RDoc to not style words, which correspond to classes or modules?

I am trying to write documentation to one of my classes using RDoc and I have the following problem:我正在尝试使用 RDoc 将文档写入我的一个类,但我遇到了以下问题:

This is my source:这是我的来源:

module Native
  module Facebook
    # Service, which starts(schedules) Native Facebook Fetching Jobs for users with Facebook platform.
    #
    # *IMPORTANT:* <tt>Native::Facebook::StartFetchingJobs</tt> is intended to be called only from <tt>config/schedule.rb</tt>.
    #
    # For example:
    #   # config/schedule.rb
    #   every :day, at: '7:00 pm' do
    #     runner 'Native::Facebook::StartFetchingJobs.call'
    #   end
    #
    class StartFetchingJobs < Service
      # ...

      def call
        # ...
      end

      # ...
    end
  end
end

This is the screenshot of generated doc:这是生成的文档的屏幕截图:

在此处输入图像描述

Since Native and Facebook are modules, RDoc highlights Native and Facebook words in the generated doc (by green text).由于NativeFacebook是模块,因此 RDoc 会在生成的文档中突出显示NativeFacebook单词(绿色文本)。

So, my question - is there a way to force RDoc to not style words, which correspond to classes or modules?所以,我的问题 - 有没有办法强制 RDoc 不设置与类或模块相对应的单词样式?

All you need to do is just precede your module and class names with a backslash.您需要做的只是在您的模块和 class 名称前加上反斜杠。

So, instead of Native and Facebook , use \Native and \Facebook .因此,不要使用NativeFacebook ,而是使用\Native\Facebook

Documentation can be found here .文档可以在这里找到。 In Escaping Text Markup section.Escaping Text Markup部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM