fix: booktab reference (fix #37)#38
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughMoves table font sizing into the table block, removes table Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
lib/components.typ (1)
163-164:⚠️ Potential issue | 🟡 MinorComment on
captionparameter doesn't match the new guard condition.Line 163 says figure is not used only when both
captionisnoneandoutlinedisfalse. But the code on line 225 requires bothoutlinedandcaption != noneto wrap in a figure. These are different conditions — e.g.,outlined: true, caption: nonewould create a figure per the comment but not per the code.Update the comment to reflect the actual behavior:
Suggested fix
-// caption: 表格标题(设为 none 且 outlined 为 false 时不使用 figure) -// outlined: 是否包装在 figure 中(默认 true),设为 false 时生成纯表格 +// caption: 表格标题(仅在 caption 不为 none 且 outlined 为 true 时包装为 figure) +// outlined: 是否允许包装在 figure 中(默认 true),设为 false 时生成纯表格Also applies to: 225-229
🧹 Nitpick comments (1)
doc/ch03-basics.typ (1)
411-417: Trailing table at end of file has a caption but no label or surrounding explanation.This
booktabwithcaption: [交叉引用表示例]appears at the end of the cross-reference section without any accompanying text or a<label>. If the intent is to demonstrate a referenceable table, consider adding a label and a sentence referencing it. If it's just decorative, a brief comment explaining its purpose would help future maintainers.
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)
lib/components.typ (1)
163-164:⚠️ Potential issue | 🟡 MinorDocstring is now inconsistent with the updated condition.
Line 163 states that figure wrapping is skipped only when both
captionisnoneandoutlinedisfalse. However, the new condition on line 225 (outlined and caption != none) skips figure wrapping whenevercaptionisnone, regardless ofoutlined. The comment should be updated to match the actual behavior.Suggested docstring update
-// caption: 表格标题(设为 none 且 outlined 为 false 时不使用 figure) -// outlined: 是否包装在 figure 中(默认 true),设为 false 时生成纯表格 +// caption: 表格标题(设为 none 时不使用 figure,不可被引用) +// outlined: 是否在 figure 中显示(默认 true),需同时设置 caption 才会包装在 figure 中Also applies to: 225-225
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)
lib/components.typ (1)
225-229:⚠️ Potential issue | 🟡 MinorEdge case:
outlined: truewithcaption: nonemay produce a broken list-of-figures entry.When
outlinedistruebut nocaptionis provided, the figure is created withcaption: none. If this figure appears inlistoffigures,caption-to-text(el.caption)receivesnone(type is neitherstrnorcontent), andlink(el_loc, none)could produce unexpected output or an error.Consider either:
- Defaulting
captionto[](empty content) whenoutlinedistrue, or- Guarding in
listoffiguresbefore callingcaption-to-text.Suggested guard in booktab
if outlined { - figure(the-table, caption: caption, kind: table) + figure(the-table, caption: if caption == none { [] } else { caption }, kind: table) } else { the-table }
Summary by CodeRabbit
Bug Fixes
Documentation
Chores