Skip to content

ISO-specific Causes linker#74

Merged
OleksiyPuzikov merged 7 commits into
aousd:mainfrom
OleksiyPuzikov:main
May 26, 2026
Merged

ISO-specific Causes linker#74
OleksiyPuzikov merged 7 commits into
aousd:mainfrom
OleksiyPuzikov:main

Conversation

@OleksiyPuzikov

@OleksiyPuzikov OleksiyPuzikov commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

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.

@pmolodo pmolodo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/iso_clause_lint.py Outdated
@pmolodo

pmolodo commented Apr 22, 2026

Copy link
Copy Markdown
Collaborator

Also - to help get this merged faster, could we split the filter and the linter into separate PRs?

OleksiyPuzikov and others added 3 commits April 24, 2026 12:14
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>
@OleksiyPuzikov OleksiyPuzikov changed the title DRAFT: ISO-specific Causes linker and clause/subclauses linter ISO-specific Causes linker Apr 24, 2026
@OleksiyPuzikov

Copy link
Copy Markdown
Collaborator Author

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?

Yes - very good idea - implemented that.

@OleksiyPuzikov

Copy link
Copy Markdown
Collaborator Author

Also - to help get this merged faster, could we split the filter and the linter into separate PRs?

Yes, thanks, done.

@pmolodo pmolodo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
Comment thread doc_build/filters/filter_iso_xrefs.py Outdated
@pmolodo

pmolodo commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Awesome, like the changes!

@OleksiyPuzikov
OleksiyPuzikov merged commit 79ba954 into aousd:main May 26, 2026
1 check 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.

2 participants