diff --git a/README.md b/README.md index 7503871..cd5940b 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,104 @@ Or with `use-package`: ## API Reference +### API Quick Reference + +A complete overview of all tp.el functions organized by category: + +#### Core Property Functions +| Function | Description | +|----------|-------------| +| `tp-set` | Set text properties (replaces specified properties only) | +| `tp-reset` | Replace ALL text properties | +| `tp-add` | Add/merge properties with deep merge support | +| `tp-set-face` | Set only the face property | +| `tp-set-display` | Set only the display property | +| `tp-get` | Get property value(s) from position or range | +| `tp-get-sub` | Get nested sub-property value | +| `tp-put-sub` | Set nested sub-property value | +| `tp-remove-sub` | Remove nested sub-property | +| `tp-at` | Get all properties at a position | +| `tp-remove` | Remove a property or sub-property | +| `tp-remove-list` | Remove multiple properties at once | +| `tp-clear` | Clear all text properties from a region | + +#### Pattern Matching Functions +| Function | Description | +|----------|-------------| +| `tp-match` | Set properties on string pattern matches | +| `tp-match-reset` | Reset all properties on string matches | +| `tp-match-add` | Add/merge properties on string matches | +| `tp-regexp` | Set properties on regexp matches | +| `tp-regexp-reset` | Reset all properties on regexp matches | +| `tp-regexp-add` | Add/merge properties on regexp matches | + +#### Search & Navigation Functions +| Function | Description | +|----------|-------------| +| `tp-forward` | Search forward for text with property | +| `tp-backward` | Search backward for text with property | +| `tp-next` | Get next position with text properties | +| `tp-prev` | Get previous position with text properties | +| `tp-goto-next` | Move point to next text with property | +| `tp-goto-prev` | Move point to previous text with property | +| `tp-regions-map` | Apply function to all regions with property | +| `tp-strings-map` | Apply function to all strings with property | + +#### Query Functions +| Function | Description | +|----------|-------------| +| `tp-in` | Find all regions with a specific property | +| `tp-all` | Get all propertized regions | +| `tp-intervals` | Get property intervals in a region | +| `tp-empty-p` | Check if object has no properties | +| `tp-plist` | Get merged plist of all properties | + +#### Layer Definition Functions +| Function | Description | +|----------|-------------| +| `tp-define-layer` | Define a layer or layer group | +| `tp-layer-props` | Get properties for a layer | +| `tp-group-props` | Get properties for all layers in a group | +| `tp-layer-undefine` | Remove layer definition | +| `tp-group-undefine` | Remove group definition | +| `tp-layer-reset` | Clear all layer/group definitions | + +#### Layer Placement Functions +| Function | Description | +|----------|-------------| +| `tp-put-layer` | Set layer at specific index position | +| `tp-push-layer` | Push layer to top of stack | + +#### Layer Deletion Functions +| Function | Description | +|----------|-------------| +| `tp-delete-layer` | Delete layer by name or index | +| `tp-pop-layer` | Remove top layer | + +#### Layer Movement Functions +| Function | Description | +|----------|-------------| +| `tp-raise-layer` | Move layer up/down by N positions | +| `tp-rotate-layer` | Cycle layers (top goes to bottom) | +| `tp-pin-layer` | Pin a layer to top (make visible) | +| `tp-switch-layer` | Swap positions of two layers | + +#### Layer Merging Functions +| Function | Description | +|----------|-------------| +| `tp-merge-layers` | Merge specified layers into a new layer | +| `tp-flatten-layers` | Flatten all layers into a single layer | + +#### Layer Query Functions +| Function | Description | +|----------|-------------| +| `tp-layer-list` | List all layer names in region | +| `tp-layer-count` | Count layers in region | +| `tp-layer-exists-p` | Check if layer exists in region | +| `tp-layer-top` | Get name of top (visible) layer | + +--- + ### Core Property Functions #### `tp-set` - Set Text Properties diff --git a/README_CN.md b/README_CN.md index 0dae273..415460b 100644 --- a/README_CN.md +++ b/README_CN.md @@ -55,6 +55,104 @@ ## API 参考 +### API 快速参考 + +tp.el 所有函数按类别组织的完整概览: + +#### 核心属性函数 +| 函数 | 描述 | +|------|------| +| `tp-set` | 设置文本属性(仅替换指定属性) | +| `tp-reset` | 替换所有文本属性 | +| `tp-add` | 添加/合并属性,支持深度合并 | +| `tp-set-face` | 仅设置 face 属性 | +| `tp-set-display` | 仅设置 display 属性 | +| `tp-get` | 从位置或范围获取属性值 | +| `tp-get-sub` | 获取嵌套子属性值 | +| `tp-put-sub` | 设置嵌套子属性值 | +| `tp-remove-sub` | 移除嵌套子属性 | +| `tp-at` | 获取某位置的所有属性 | +| `tp-remove` | 移除属性或子属性 | +| `tp-remove-list` | 一次移除多个属性 | +| `tp-clear` | 清除区域中的所有文本属性 | + +#### 模式匹配函数 +| 函数 | 描述 | +|------|------| +| `tp-match` | 在字符串匹配处设置属性 | +| `tp-match-reset` | 在字符串匹配处重置所有属性 | +| `tp-match-add` | 在字符串匹配处添加/合并属性 | +| `tp-regexp` | 在正则匹配处设置属性 | +| `tp-regexp-reset` | 在正则匹配处重置所有属性 | +| `tp-regexp-add` | 在正则匹配处添加/合并属性 | + +#### 搜索和导航函数 +| 函数 | 描述 | +|------|------| +| `tp-forward` | 向前搜索具有属性的文本 | +| `tp-backward` | 向后搜索具有属性的文本 | +| `tp-next` | 获取下一个具有文本属性的位置 | +| `tp-prev` | 获取上一个具有文本属性的位置 | +| `tp-goto-next` | 移动光标到下一个具有属性的文本 | +| `tp-goto-prev` | 移动光标到上一个具有属性的文本 | +| `tp-regions-map` | 对所有具有属性的区域应用函数 | +| `tp-strings-map` | 对所有具有属性的字符串应用函数 | + +#### 查询函数 +| 函数 | 描述 | +|------|------| +| `tp-in` | 查找所有具有特定属性的区域 | +| `tp-all` | 获取所有带属性的区域 | +| `tp-intervals` | 获取区域中的属性区间 | +| `tp-empty-p` | 检查对象是否没有属性 | +| `tp-plist` | 获取所有属性的合并列表 | + +#### 图层定义函数 +| 函数 | 描述 | +|------|------| +| `tp-define-layer` | 定义图层或图层组 | +| `tp-layer-props` | 获取图层的属性 | +| `tp-group-props` | 获取图层组中所有图层的属性 | +| `tp-layer-undefine` | 移除图层定义 | +| `tp-group-undefine` | 移除图层组定义 | +| `tp-layer-reset` | 清除所有图层/图层组定义 | + +#### 图层放置函数 +| 函数 | 描述 | +|------|------| +| `tp-put-layer` | 在指定索引位置设置图层 | +| `tp-push-layer` | 将图层推到堆栈顶部 | + +#### 图层删除函数 +| 函数 | 描述 | +|------|------| +| `tp-delete-layer` | 按名称或索引删除图层 | +| `tp-pop-layer` | 移除顶层图层 | + +#### 图层移动函数 +| 函数 | 描述 | +|------|------| +| `tp-raise-layer` | 将图层上移/下移 N 个位置 | +| `tp-rotate-layer` | 轮换图层(顶层移到底部) | +| `tp-pin-layer` | 将图层置顶(使其可见) | +| `tp-switch-layer` | 交换两个图层的位置 | + +#### 图层合并函数 +| 函数 | 描述 | +|------|------| +| `tp-merge-layers` | 将指定图层合并为新图层 | +| `tp-flatten-layers` | 将所有图层扁平化为单一图层 | + +#### 图层查询函数 +| 函数 | 描述 | +|------|------| +| `tp-layer-list` | 列出区域中的所有图层名称 | +| `tp-layer-count` | 计算区域中的图层数量 | +| `tp-layer-exists-p` | 检查区域中是否存在某图层 | +| `tp-layer-top` | 获取顶层(可见)图层的名称 | + +--- + ### 核心属性函数 #### `tp-set` - 设置文本属性