Skip to content

spec: Enable heading numbering for section references in shiroa#534

Merged
RobinJadoul merged 2 commits into
spec/mainfrom
spec/shiroa-heading-numbering
Apr 28, 2026
Merged

spec: Enable heading numbering for section references in shiroa#534
RobinJadoul merged 2 commits into
spec/mainfrom
spec/shiroa-heading-numbering

Conversation

@RobinJadoul
Copy link
Copy Markdown
Collaborator

No description provided.

@RobinJadoul RobinJadoul added the spec Updates and improvements to the spec document label Apr 23, 2026
@RobinJadoul RobinJadoul self-assigned this Apr 23, 2026
@github-actions
Copy link
Copy Markdown

Codex Code Review

Findings

  • Low: spec/book.typ introduces a global per-page heading numbering scheme, but it is still overridden by the existing local rule in spec/logup.typ. That leaves logup.typ with different numbering from the rest of the Shiroa pages, so the PR does not actually make heading numbering consistent across all chapters. If the intent is standardization, this needs to be reconciled.

No security vulnerabilities or significant performance issues stood out in this diff.

Comment thread spec/book.typ
@claude
Copy link
Copy Markdown

claude Bot commented Apr 23, 2026

Review of spec/book.typ

This is a spec-only documentation change — no security implications.

Whitespace fix (line 147): Unambiguously correct. Fixes cross-references rendering as Section1.2Section 1.2.

Heading numbering (lines 188–191): Correct in structure — position() cannot return none because line 161 already guards that, and counter(heading).update(0) is placed after the phantom xref-include calls so the reset is clean.

Issues

Low — logup.typ overrides the new numbering

logup.typ line 4 has #set heading(numbering: "1."). In Typst, a set rule inside #body re-overrides the one set before it by book-page, so logup.typ headings will still display plain 1., 1.1. instead of the chapter-prefixed numbers. Fix: remove the #set heading(numbering: "1.") from logup.typ since book-page now handles it.

Low — heading depth limited to 2 levels (see inline comment on line 189)

The "1.1" pattern silently drops counter values beyond depth 2. logup.typ uses === (depth-3) headings, so those render chapter.a.b instead of chapter.a.b.c. Consider "1.1.1" if deep sub-section numbering is desired.

Low — shadowed args parameter (style)

book-page takes ..args as its own variadic parameter, and the new heading numbering closure also names its parameter ..args, shadowing the outer one. Not a bug (the outer args is already consumed before this point), but renaming the inner one to e.g. ..nums would improve readability.

Base automatically changed from spec/shiroa-fixes to spec/main April 28, 2026 14:56
@RobinJadoul RobinJadoul force-pushed the spec/shiroa-heading-numbering branch from fc56b03 to 5c81ee1 Compare April 28, 2026 15:01
@RobinJadoul RobinJadoul merged commit b6478d6 into spec/main Apr 28, 2026
2 checks passed
@RobinJadoul RobinJadoul deleted the spec/shiroa-heading-numbering branch April 28, 2026 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

spec Updates and improvements to the spec document

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants