Skip to content

Cleanup: naming, nesting, error handling, load_lib#38

Merged
gvonnessi merged 1 commit into
mainfrom
cleanup/remaining-items
Feb 4, 2026
Merged

Cleanup: naming, nesting, error handling, load_lib#38
gvonnessi merged 1 commit into
mainfrom
cleanup/remaining-items

Conversation

@gvonnessi

Copy link
Copy Markdown
Collaborator

Summary

  • API naming consistency: Rename convert_* functions in lib/academic.lua to bare names (theorem(), proof(), etc.) matching the convention in blocks.lua, reader_blocks.lua, and reader_academic.lua. convert_div() kept as top-level dispatcher.
  • Reduce nesting in figure(): Merge two-pass subfigure scan into single pass; extract caption logic into local extract_figcaption() helper.
  • Error handling: Add io.stderr:write() warnings in academic.lua for unexpected nil/empty classes in classify_div() and unmatched academic types in convert_div().
  • Unified load_lib(): Both codex.lua and cdx-reader.lua now use identical path resolution (script_dir first, then lib/, then cdx-pandoc/lib/) and dofile().

Test plan

  • make clean && make test — all 270 unit tests pass
  • make test-reader — all 27 round-trip tests pass
  • make test-golden — all golden baselines match exactly

… load_lib

- Rename convert_* functions in academic.lua to bare names matching
  convention in blocks.lua, reader_blocks.lua, reader_academic.lua
- Merge two-pass subfigure scan in figure() into single pass and
  extract caption logic into local extract_figcaption() helper
- Add io.stderr:write() warnings in academic.lua for unexpected
  nil/empty classes and unmatched academic types
- Unify load_lib() in codex.lua and cdx-reader.lua to use same
  path resolution order (script_dir first) and dofile()
@gvonnessi gvonnessi merged commit e0950a3 into main Feb 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant