Delphi 7使用PasDoc生成文档

        PasDoc是一个ObjectPascal源代码文档工具。从源代码中发现的注释而生成的文档。在代码中应该如何写注释,才能让PasDoc自动识别而生成文档,官网做了详细的介绍( http://pasdoc.sipsolutions.net/PasDoc)。当前版本为 0.12.1,下载Win32版本,里面再分有命令行版本跟GUI图形界面版本,因为英文看着不方便,而且输出为" HTML Help Workshop"时,并没有生成CHM文件,需要自己下载"Microsoft HTML Workshop"来生成,所以我将它整合起来,并且汉化( 有错误的话,请使用原版,或通知我)。界面如下图所示:
    
代码注释方式:
1.基本规则
        如你要为一个单元,一个类,字段,方法,变量,类型,常量,函数或过程等等做一些描述注释,你只要将注释放在这些声明的上面即可(注意:是声明,而不是实现!!即 implementation以上区域)。如:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ Description of MyUnit. } 
unit MyUnit; 
 
interface 
 
type 
  { Description of TMyClass. } 
  TMyClass = class 
  public 
    { Description of MyField. } 
    MyField: Integer; 
    { Description of MyMethod. } 
    procedure MyMethod; 
  end
 
  { Description of TMySimpleType. } 
  TMySimpleType = 1..100
 
  { Description of TMyEnumType. } 
  TMyEnumType = ( 
    { Description of meFirstValue. } 
    meFirstValue, 
    { Description of meSecondValue. } 
    meSecondValue); 
 
const 
  { Description of MyConstant. } 
  MyConstant = 4
 
var 
  { Description of MyVariable. } 
  MyVariable: Integer; 
 
{ Description of MyProcedure. } 
procedure MyProcedure; 
 
implementation 
... 
end
2.更详细的规则
        在一个声明中的多个字段/变量,如:
01
02
03
04
05
06
07
08
09
10
11
12
13
type 
  TMyRecord = record 
    { This comment documents Field1 and Field2 } 
    Field1, Field2, 
      { This comment documents Field3 and Field4 } 
      Field3, Field4: Integer; 
  end
 
var 
  { This comment documents Variable1 } 
  Variable1, 
    { This comment documents Variable2 } 
    Variable2: Integer; 
        将注释放到声明后面,如:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
unit MyUnit; 
 
{< Here you can place a description of MyUnit. 
   This is convenient for people that like to always 
   keep the "unit UnitName;" declaration 
   as the first line of their *.pas files. } 
 
interface 
 
type 
  TMyClass = class 
    MyField: Integer; //< Description of MyField 
    procedure MyProc; //< Description of MyProc 
    property MyProp: Integer read MyField write MyField; 
      //< Description of MyProp 
  end
        粘合单行注释,如:
01
02
03
04
05
06
07
08
09
10
11
12
13
14
{ This is 
  description of 
  procedure Foo. } 
procedure Foo; 
 
// This is 
// description of 
// procedure Foo. 
procedure Foo; 
 
procedure Foo; 
//< This is 
// description of 
// procedure Foo. 
        标识符或声明的多个注释,如:
1
2
3
4
5
6
7
8
9
type 
  // This comment is overwritten later 这个注释待会被覆盖 
  TMyEnumType = ( 
  // Description of meOne 
    meOne, 
    meTwo, //< Description of meTwo 
    meThree 
  ); 
 //< Description of TMyEnumType, *not* of meThree  
        常见的情况下,注释对PasDoc是没有意义的,为了防止无意义的注释加到了声明上,可以在声明上放一个空注释,如:
1
2
3
4
{ procedure Foo; } 
 
{ } 
procedure Bar; 
支持的标签按英文字母顺序:
  • @@: 字面上插入@字符
  • @abstract: 指定一个简短的摘要描述

  • @anchor: 在简介/结束语里面设置了一个看不见的

  • @author:指定作者的姓名和电子邮件地址

  • @bold:使用加粗字体格式化文本

  • @br: 强制换行

  • @cell: 创建一个表中的单元

  • @classname:插入类的名称

  • @code: 代码示例格式化参数 (see alsoLongcodeTag)

  • @created:指定这个项目创建日期

  • @cvs从cvs标签的 $Date 和 $Author关键字获得最后修改时间作者姓名

  • @definitionList:创建定义列表

  • @deprecated:标记此为已过时的

  • @exclude:从文档排除这个项

  • @false:插入特殊格式的文本"false"

  • @html: 插入直接HTML代码HTML输出

  • @image: 包括图像文件

  • @include:文件包含描述

  • @inherited:插入祖先类或成员名称

  • @inheritedClass:插入祖先类名称

  • @italic:使用斜体字体格式化文本

  • @item: 设为列表项

  • @itemLabel:定义列表下一个项定义标签

  • @itemSetNumber:更改有序列表里面下一个项

  • @itemSpacing:控制列表中的项之间垂直间距

  • @lastmod:指定这个项最后修改日期

  • @latex: 插入直接LaTeX代码到LaTeX输出

  • @link: 插入到另一个项链接

  • @longcode:Pascal代码示例格式化参数(see alsoCodeTag)

  • @member:指定这个结构描述一个特定的成员(字段,属性,方法

  • @name:插入这个项名称

  • @nil:插入特殊格式的文本"nil" 

  • @noAutoLink: 在这个标签里面的参数将从未使用自动链接

  • @noAutoLinkHere:从不自动链接这个项

  • @orderedList: 创建有序列表

  • @param:描述此方法的参数过程/函数

  • @preformatted:插入文本使用固定宽度字体保留空白

  • @raises:描述通过这种方法可能引发的异常

  • @return, @returns:描述函数的返回值

  • @row: 创建一个表中的行

  • @rowHead:创建一个表中的标题行

  • @section: 在简介/结束语里面开始新的一节

  • @seealso:创建“See also”一节中给定的项目

  • @shorttitle: 简介/结束语的简称

  • @table: 创建一个表

  • @tableOfContents: 在简介/结束语里面插入表的内容

  • @title: 简介/结束语的标题

  • @true:插入特殊格式的文本"true"

  • @unorderedList: 创建无序列表

  • @value: 指定这个结构描述为一个特定的枚举值

其他一些特殊的@结构:

           PasDoc_GUI的使用,按照向导就可以,设置好" 选项",再添加" 源文件",根据需要设置"可见的成员",在"自定义文件"可添加简介/结束语文件等其他,按F9即可生成。效果如下所示:

下载地址:
1.仅可执行程序:http://dl.dbank.com/c06bvf4xux   http://good.gd/1663381.htm
2.可执行程序和源码:http://download.csdn.net/detail/akof1314/3666897 http://dl.dbank.com/c0hj8iza0p

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值