ReStructuredText 驱动类

用于生成 rst 格式
属性
命名空间 fize\doc\driver
类名 ReStructuredText
方法:
方法名 说明
original() 原样输出字符串
title() 标题
modify() 修饰字符串
modifyEmphasis() 修饰:强调
modifyQuote() 修饰:引用
block() 文字块
table() 表格
link() 链接
field() 字段
directive() 指令

方法

original()

原样输出字符串

public static function original (
    string $str,
    array $replaces = []
) : string
参数:
名称 说明
str 待输出字符串
replaces 待替换字符

title()

标题

public static function title (
    string $title,
    int $level,
    bool $original = true
) : string
参数:
名称 说明
title 标题
level 级别
original 是否原样输出标题

modify()

修饰字符串

public static function modify (
    string $str,
    string $modifier
) : string
参数:
名称 说明
str 待修饰字符串
modifier 修饰符

modifyEmphasis()

修饰:强调

public static function modifyEmphasis (
    string $str
) : string
参数:
名称 说明
str 待修饰字符串

modifyQuote()

修饰:引用

public static function modifyQuote (
    string $str
) : string
参数:
名称 说明
str 待修饰字符串

block()

文字块

public static function block (
    string $content,
    int $indent = 4,
    bool $original = true
) : string
参数:
名称 说明
content 内容
indent 缩进
original 是否原样输出

table()

表格

public static function table (
    array $rows,
    array $headers = [],
    bool $original = true,
    bool $simple = false
) : string
参数:
名称 说明
rows 数据
headers 表头
original 是否原样输出字符串(即非转义)
simple 是否使用简易表格

field()

字段

public static function field (
    string $name,
    string $desc,
    bool $original = true,
    int $indent = 2
) : string
参数:
名称 说明
name 字段名
desc 详细描述
original 是否原样输出详细描述
indent 缩进

directive()

指令

public static function directive (
    string $name,
    string $desc,
    array $options = [],
    string $content = ""
) : string
参数:
名称 说明
name 指令名称
desc 指令明细
options 指令选项
content 附加内容