使用Rdoc生成ruby说明文档

几点说明

"-":代表缩进的符号列表
"[]":代表描述列表,方括号内的是被描述的对象,比如这里是cat,跟着的是描述说明,描述说明将换行缩进显示
"<em></em>":表示文本为斜体
"<b></b>":表示文本为粗体
"-- ++":之间的文本不会被解析,也就是在api文档中看不到这段文本
"http:":文本为超链接
"::":冒号

代码

class Demo
  # - 测试
  # [cat] a kind of animal
  # [+dog+] also a pet
  # = leval one
  # - == leval two
  # and so on
  # ----
  # how about this
  # - http:www.baidu.com
  def foo(name)
    @name = name
  end


  # Extract the age and calculate the
  # date-of-birth.
  #--
  # FIXME: fails if the birthday falls on
  # February 29th
  #++
  # The DOB is returned as a Time object.

  def get_dob(person)

  end
end

效果



class Demo

Public Instance Methods

foo(name)
  • 测试

cat

a kind of animal

dog

also a pet

leval one

  • leval two

and so on


how about this




get_dob
(person)

Extract the age and calculate the date-of-birth. The DOB is returned as aTime object.




英文文档介绍, http://rdoc.sourceforge.net/doc/index.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值