ISO-specific Causes linker#74
Conversation
pmolodo
left a comment
There was a problem hiding this comment.
Haven't finished reviewing everything yet, but before I do... at a higher level, this package is doing a lot of ad-hoc markdown parsing. I'm worried that this simple-regular-expression parsing will end up being fragile and high maintenance. Did you consider using pandoc's AST, or a third-party markdown python library?
|
Also - to help get this merged faster, could we split the filter and the linter into separate PRs? |
The linter (iso_clause_lint.py, iso_lint command, make_iso_lint_parser) has been moved to the feature/iso-clause-lint branch for a separate PR. This branch retains only the ISO cross-reference filter implementation. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Yes - very good idea - implemented that. |
Yes, thanks, done. |
pmolodo
left a comment
There was a problem hiding this comment.
I have some comments for possible improvements, but if you'd rather not spend more time on this one, I'm ok with taking it in it's current state, so I'm approving.
|
Awesome, like the changes! |
Implement the Pandoc filter that's replacing the links with the "Clause #.#.#" references, according to the ISO requirements. ISO cross-references, URL display, bibliography citation format.
Three transformations applied to the Pandoc AST:
a. Internal relative links (e.g. path grammar) → ISO clause reference text appended to the clickable anchor link (e.g. path grammar(Clause 7), 7.3).
b. External hyperlinks where the link text differs from the URL → URL appended in parentheses for paper-copy readability (e.g. "RFC 3986 (https://datatracker.ietf.org/doc/html/rfc3986)").
c. Inline bibliography citations ([1], [2] …) → "Reference [1]", "Reference [2]" …
Clause numbering is driven by iso_clause_map.yaml (an exceptions list): sections absent from the map are auto-numbered sequentially; sections listed as null are left unnumbered; sections listed as {annex: "A"} become annexes.
WARNING: this is implemented mostly by Claude Sonnet 4.6, and reviewed by me.