docs(doc): clarify formula rendering - #2043
Conversation
📝 WalkthroughWalkthrough本次变更完善 Changes公式与文档格式规范
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
|
There was a problem hiding this comment.
Pull request overview
This PR updates the lark-doc Skill documentation to prevent agents from writing Markdown/LaTeX delimiters as literal text when using the default XML document format, and to make formula authoring/verification rules explicit for both XML and Markdown modes.
Changes:
- Adds a high-level “formula routing” rule to the Skill’s quick-decision section to distinguish XML (
<latex>...</latex>) vs Markdown ($...$) behavior. - Adds an XML formula section explaining
<latex>usage, escaping requirements, and a post-writedocs +fetch --doc-format xml --detail fullverification step. - Adds a Markdown formula section with inline/standalone examples, escaping guidance for literal
$, and@fileguidance for shell safety.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| skills/lark-doc/SKILL.md | Adds a top-level decision rule for formula handling across XML vs Markdown paths. |
| skills/lark-doc/references/lark-doc-xml.md | Documents XML-specific formula syntax using <latex> and recommends post-write verification. |
| skills/lark-doc/references/lark-doc-md.md | Documents Markdown formula syntax and recommends verification via XML fetch after writes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - 用户明确要操作思维笔记时;已有**思维笔记**,走 [思维笔记链路](references/lark-doc-mindnote.md);新建**思维笔记**,走 [lark-doc-whiteboard](references/lark-doc-whiteboard.md) | ||
| - 拿到 spreadsheet URL/token 后 → 切到 `lark-sheets` 做对象内部操作 | ||
| - 用户需要统计文档的**总字数 / 总字符数**(word count / character count)时,先读取 [`lark-doc-word-stat.md`](references/lark-doc-word-stat.md),并按其中流程调用 [`scripts/doc_word_stat.py`](scripts/doc_word_stat.py);统计口径以该脚本为准,不要改用其他方式自行计算。 | ||
| - 文档包含数学公式时,先按所选格式读取对应公式规则:XML 使用 `<latex>...</latex>`,**禁止**把 `$...$`、`$$...$$`、`\(...\)` 或 `\[...\]` 原样写入 XML;Markdown 才使用 `$...$`。含 `$` 或反斜杠的内容优先通过相对 `@file` 传入,避免 Shell 改写公式。详见 [`lark-doc-xml.md`](references/lark-doc-xml.md#公式) / [`lark-doc-md.md`](references/lark-doc-md.md#数学公式)。 |
| - 不要把公式放进 `<pre>` 或 `<code>`;代码块只会显示公式源码。 | ||
| - 内容含反斜杠时,优先把完整 XML 保存到当前工作目录下的文件,并通过相对路径传入:`--content @formula.xml`。不要使用绝对 `@file` 路径。 | ||
|
|
||
| 常见定界符转换: |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
skills/lark-doc/references/lark-doc-md.md (1)
32-33: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick winCorrect the expected output for escaped
*and_.Markdown uses the backslash only in the input; rendering removes it. The examples currently show
3 \* 5 = 15andfoo\_bar\_bazas outputs, which teaches users that the escape remains visible.Proposed correction
-| `*` | 斜体 / 加粗 | `\*` | `3 \* 5 = 15` → 3 \* 5 = 15 | +| `*` | 斜体 / 加粗 | `\*` | `3 \* 5 = 15` → 3 * 5 = 15 | -| `_` | 斜体 / 加粗 | `\_` | `foo\_bar\_baz` → foo\_bar\_baz | +| `_` | 斜体 / 加粗 | `\_` | `foo\_bar\_baz` → foo_bar_baz |🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@skills/lark-doc/references/lark-doc-md.md` around lines 32 - 33, Update the expected-output examples in the escaping table for `*` and `_`: retain the backslashes only in the input column, and show rendered outputs as `3 * 5 = 15` and `foo_bar_baz` without escape characters.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@skills/lark-doc/references/lark-doc-md.md`:
- Around line 32-33: Update the expected-output examples in the escaping table
for `*` and `_`: retain the backslashes only in the input column, and show
rendered outputs as `3 * 5 = 15` and `foo_bar_baz` without escape characters.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 0f9c3a4e-a846-41d2-8533-3a63ed38f193
📒 Files selected for processing (3)
skills/lark-doc/SKILL.mdskills/lark-doc/references/lark-doc-md.mdskills/lark-doc/references/lark-doc-xml.md
|
Thanks for the contribution and for documenting this edge case. The issue is valid, but it appears to be a very low-probability edge case. We do not want to keep patching the Skill for every boundary scenario: doing so would make the Skill unnecessarily large and increase maintenance and model-reading costs. For now, we will not merge this PR and will close it. If we keep a reminder, please reduce the change to a single sentence:
We can revisit the documentation when XML mode supports Markdown syntax at the product level. Thanks for understanding. |
Summary
Clarify formula authoring in the
lark-docSkill so agents do not write Markdown/LaTeX delimiters as literal text whendocs +createordocs +updateuses the default XML format.The root cause is that native
<latex>...</latex>support was only mentioned in the XML component table, while the format-dependent conversion rule was not prominent. This change makes the XML and Markdown paths explicit and adds a post-write verification step.Changes
skills/lark-doc/SKILL.md.$...$,$$...$$,\(...\), and\[...\]to native<latex>nodes.@fileinput guidance.Test Plan
node scripts/skill-format-check/index.jsgit diff --checklark-cli docs +create/+updateflow — not run; requires Feishu/Lark tenant access.Related Issues
Summary by CodeRabbit
<latex>...</latex>, including escaping and validation requirements.